my mongo-java-driver version is 3.12.10
mongodb version is 6.0.4,and a sharded cluster is deployed
Execute the following command in the java program to report an error
com.mongodb.MongoCommandException: Command failed with error 59 (CommandNotFound): 'no such command: 'shardCollection'' on server xxx:27018. The full response is {"ok": 0.0, "errmsg": "no such command: 'enableSharding'", "code": 59, "codeName": "CommandNotFound", "lastCommittedOpTime": {"$timestamp": {"t": 1688634311, "i": 1}}, "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1688634317, "i": 3}}, "signature": {"hash": {"$binary": {"base64": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "subType": "00"}}, "keyId": 0}}, "operationTime": {"$timestamp": {"t": 1688634311, "i": 1}}}
this is my command
Document append = new Document("shardCollection", new BsonString(dataBase + "." + collect)).append("key", new Document("_id", "hashed")); admin.runCommand(append);
Is the reason for this error because mongo-driver does not support fragmentation? Can someone help me? Thanks a lot