There are like 5 update operators: $inc, $rename, $setOnInsert, $set, and $unset
When doing a update with upsert option set to true, what will be the value of a newly created document (considering that it does not exist, thus, upsert it), for a field with this update query:
{$inc: {age: 1}}
So the newly inserted document will have the value 1? since It does not exist before. Am I right?
If the operator is $rename, the what would be the value of the field, null? Or the field will not be created as part of the new document to be inserted?
Update:
If the update query is a rename update:
db.students.update( { _id: 1 }, { $rename: { 'nickname': 'alias', 'cell': 'mobile' } } )