You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mongoengine.errors.OperationError: Update failed (Query for sharded findAndModify must contain the shard key, full error: {'ok': 0.0, 'errmsg': 'Query for sharded findAndModify must contain the shard key', 'code': 61, 'codeName': 'ShardKeyNotFound'})
_id
is the shard keygets this error
mongoengine.errors.OperationError: Update failed (Query for sharded findAndModify must contain the shard key, full error: {'ok': 0.0, 'errmsg': 'Query for sharded findAndModify must contain the shard key', 'code': 61, 'codeName': 'ShardKeyNotFound'})
the command log is
Command SON([('findAndModify', 'user'), ('query', {'$and': [{'_id': ObjectId('60d96a58ea9596f92ba54c7e')}, {'_id': ObjectId('60d96a58ea9596f92ba54c7e')}]}), ('new', True), ('update', {'$set': {'name': 'ok'}}), ('upsert', False)])
Environment
when I use older project with same db, it works without error
the command log is
Command SON([('findAndModify', 'user'), ('query', {'_id': ObjectId('60d96a58ea9596f92ba54c7e')}), ('new', True), ('update', {'$set': {'name': 'ok'}}), ('upsert', False)])
Older Environment
I notice newer version
query
has a$and
operator, and I try it in mongo shell, gets same error.The text was updated successfully, but these errors were encountered: