Kris_Simon
(Kris Simon)
September 14, 2021, 12:01pm
1
Hi,
I have a script that configures some shards for collections. Sometimes this command works fine:
{"shardCollection": "mydb.testCollection", "key": {"client": "hashed", "_id": 1 }}
But most of the times i get a no such cmd: key
error.
Why is it and how can I avoid this error?
Using: MongoDB 5.0.2
Kris_Simon
(Kris Simon)
September 15, 2021, 6:10pm
2
Got it. I cast a json into a bson. json’s object has no order, but bson’s.
So while getting bson(fromjson: json) the order was not guaranteed. Edit the bson directly works.
1 Like
system
(system)
Closed
September 20, 2021, 6:10pm
3
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.