Upsert vs Insert+Update Performance

34 views
Skip to first unread message

Leon Pajak

unread,
Dec 6, 2014, 7:43:56 AM12/6/14
to mongod...@googlegroups.com
Hello,
I am inserting documents to collection. When there is already document with such key I do update instead of insert.

Breakdown looks like that:
90% cases: insert->OK
10% cases: insert->Unique Exception->Update->OK

In such circumstances what would be better(faster) solution:
 - To insert and update if i get unqiue exception
OR
- To upsert




Reply all
Reply to author
Forward
0 new messages