1 | initial version |
No, ObjectId is also generated during updates in Spring data mongodb. Spring data mongodb generates an ObjectId by default for each new document inserted into a collection, regardless of whether it is a save or an update operation. However, you can also provide your own custom generated ObjectId for each document by setting the _id field with a value of your choosing before you save or update the document.