I need to know if an upsert inserted, using MongoEngine (or if necessary, pymongo).
The code looks like this:
ret = MyMongoCollection.objects(name=desiredname)
.update_one( { upsert: True, field1: 2 } )
Mongoengine seems to return only "num_affected" which is always exactly 1 here, by definition.
I know these exist, but I'm looking for the Python flavor.