MongoDB Tutorial for Beginners - Difference Between Save and Insert method in MongoDB - Part 9

preview_player
Показать описание
Learn the basic difference between Save and Insert method in MongoDB.

Updates an existing document or inserts a new document, depending on its document parameter. The save() method uses either the insert or the update command, which use the default write concern. To specify a different write concern, include the write concern in the options parameter.

Insert
If the document does not contain an _id field, then the save() method calls the insert() method. During the operation, the mongo shell will create an ObjectId and assign it to the _id field.
Рекомендации по теме
Комментарии
Автор

thanks dude, this is really helpful

Regards from Argentina!

santiagobustamante