db.test.test->insert ({_id: 1, key1: 'value1'})
db.test.test->update ({_id: 1}, {$set: {key1: 'value1'}})
D:\MongoDB>mongo --verbose
MongoDB shell version: 2.6.3
...
> db.test.insert({_id:1, key1:"value1"})
WriteResult({ "nInserted" : 1 })
> db.test.update({_id:1}, {$set:{key1:"value1"}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })
> db.test.update({_id:1}, {$set:{key1:"value2"}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })