. 2019-12-12 · Configuring Srping Data MongoDB Annotations. First, the Java domain used in this tutorial must be configured in order to insert MongoDB document using Spring data. Modify the Product.java class by appending some of the annotations with the following command: The @Document annotation is used to mark this Java class as the document of the MongoDB. MongoDB Auto-Increment fields in document. admin Mongo.MongoDB Auto-Increment fields in document Today in this article will see how to perform an update to the mongo document and MongoDB Auto-Increment fields in the update or insert operation. This auto-increment could be needed to keep the uniqueness of similar... Continue Reading. To implement triggers for auto-increment, log into your MongoDB.