SERVER-8172 Exclude $not query operator fields from new upsert document.
SERVER-8048: catch exception if toString() doesn't exist on an object.