Hi everyone, I’m a newbie and just getting into MongoDB.
Now encountered a strange problem, unable to perform sharding. I use Windows 11, MongoDB6.0.6, and log in through the Windows command line → mongosh. After entering the command at the correct position, it is always prompted:
test> sh.shardCollection("INVENTORY.inventory", { name : "hashed" })
MongoServerError: no such command: 'shardCollection'. Are you connected to mongos?
What should I do?
Thanks!