Related to performing an updateFirst operations, you can also perform an upsert operation which will perform an insert if no document is found that matches the query. The document that is inserted is a combination of the query document and the update document.
I think upsert operation should use a combination of query and update to do the insertion instead of only inserting the update part
reference:
http://docs.spring.io/spring-data/mongodb/docs/1.4.3.RELEASE/reference/html/mongo.core.html
Related to performing an updateFirst operations, you can also perform an upsert operation which will perform an insert if no document is found that matches the query. The document that is inserted is a combination of the query document and the update document.