How to determine if $addToSet actually added a new item into a MongoDB document or if the item already existed?
问题 I'm using the C# driver (v1.8.3 from NuGet), and having a hard time determining if an $addtoSet/upsert operation actually added a NEW item into the given array, or if the item was already existing. Adding a new item could fall into two cases, either the document didn't exist at all and was just created by the upsert, or the document existed but the array didn't exist or didn't contain the given item. The reason I need to do this, is that I have large sets of data to load into MongoDB, which