I'm using Mongo's native node driver. For an upsert like:
collection.update(query, setData, { upsert: true }, callback);
Is there a way to determine if the upsert did an insert or an update? With Mongo shell you can get back WriteResult.nUpserted
to determine this, but I'm unsure how to get that info back from the node native driver.
http://docs.mongodb.org/manual/reference/method/WriteResult/#WriteResult.nUpserted
Thanks.