Fixing the attached test case so that we never inadvertently replace an existing document could be done by adding `{$where: 'false'}` to the criteria (forcing an insert) or more simply falling back to an insert operation. In either case, users with perfectly legitimate use cases might see a uniqueness exception from MongoDB.