0 votes
1 view
in Web Technology by (42.1k points)

I want to know what is the exact difference between "save" and "insert" command in MongoDB? For me, both syntaxes look the same:



Please guide me:-)

1 Answer

0 votes
by (90.8k points)
edited by

The instances that you have provided, the action for both save and insert is essentially the same because as the document provided in 'save' has no _id field.

But the main difference between 'save' and 'insert' command is that the 'save' command can insert or update a document whereas 'insert' only performs the insertion.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
asked Oct 16, 2019 in Web Technology by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !