The difference between the MongoDB save () method and the Insert () method first look at what the official documents say 
 
  
  Updates an existing document or inserts a new document, depending on its document parameter
 
 
 
The Save method has both the ability to update and insert, and whether to insert or update the document depends on the save parameter. So what parameters do you depend on? Keep looking.
 
 
  
  If The document does not contain a _id field, then the Save () method calls the Insert () method. During the operation, the MONGO Shell would create an ObjectId and assign it to the _id field.
 
 
 
You can see whether the decision is to insert a document or update, depending on the _id parameter. If you can find a document that already exists according to _ID, then update it. If you do not pass in the _id parameter or you cannot find a document that exists, insert a new document.
To cite an official example
With no _id parameters
 
 
  
  Db.products.save ({item: "Book", Qty:40})
 
 
 
Results 
 
  
  {"_id": ObjectId ("50691737d386d8fadbd6b01d"), "Item": "Book", "Qty": 40}
 
 
 
The MongoDB client driver will automatically generate a default for you
Objectid as _id.
With _id parameter, but cannot find a document that already exists
 
 
  
  Db.products.save ({_id:100, item: "Water", qty:30})
 
 
 
Results 
 
  
  {"_id": +, "item": "Water", "qty": 30}
 
 
 
or insert a new document, but _id is not automatically generated.
With _id parameter, but there is a document that exists
 
 
  
  Db.products.save ({_id:100, item: "Juice"})
 
 
 
Results 
 
  
  {"_id": +, "item": "Juice"}
 
 
 
Updated the document
Summarize 
 
  
  - Insert: If the primary key of the new data already exists, the org.springframework.dao.DuplicateKeyException exception will be thrown to repeat the primary key, not saving the current data.
- Save: If the primary key for the new data already exists, the existing data will be modified.
The difference between the MongoDB save () method and the Insert () method