scottwrobinson / camo

A class-based ES6 ODM for Mongo-like databases.
556 stars 80 forks source link

Upsert operation problem #96

Open lujiajing1126 opened 7 years ago

lujiajing1126 commented 7 years ago

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.