(MongoDB) A single update on a sharded collection must contain an exact match on _id error
In sharding Mongodb cluster
If you do CUD working, it is possible to show you next possible
A single update on a sharded collection must contain an exact match on _id (and have the collection default collation) or contain the shard key (and have the simple collation). Update request
This happend when I did updateFirst query in MongoDB.
Beacuse shard cluster does not find where this document,
the mongos can not find where it is.
actuall UpdateFirst means that to update one document.
If Mongos brodcast all shard cluster to update, it is to violate {multi: false} pharse.
Therefor,
to solve this error,
we need to do one of three
1. to add shard key in query
2. to specify "_id" field which is unique key
3. to configure { multi : true }
If you do CUD working, it is possible to show you next possible
A single update on a sharded collection must contain an exact match on _id (and have the collection default collation) or contain the shard key (and have the simple collation). Update request
This happend when I did updateFirst query in MongoDB.
Beacuse shard cluster does not find where this document,
the mongos can not find where it is.
actuall UpdateFirst means that to update one document.
If Mongos brodcast all shard cluster to update, it is to violate {multi: false} pharse.
Therefor,
to solve this error,
we need to do one of three
1. to add shard key in query
2. to specify "_id" field which is unique key
3. to configure { multi : true }
댓글
댓글 쓰기