How to properly do a Bulk upsert/update in MongoDB
问题 I'm trying to: Find a document according to a search criteria, If found, update some attributes If not insert a document with some attributes. I'm using a Bulk.unOrderedOperation as I'm also performing a single insert. And I want to do everything in one operation againast DB. However something it's causing nothing is being inserted for the update/upsert operation. This is the insert document: var lineUpPointsRoundRecord = { lineupId: lineup.id, // String totalPoints: roundPoints, // Number