I'm using the Mongoose Library for accessing MongoDB with node.js
Is there a way to remove a key from a document? i.e. not just set the value to null, but remove it?
User.findOne({}, function(err, user){
  //correctly sets the key to null... but it's still present in the document
  user.key_to_delete = null;
  // doesn't seem to have any effect
  delete user.key_to_delete;
  user.save();
});
 
     
     
     
     
     
     
     
     
     
     
     
    