我想知道如何使用mongocxx 3.1.3(Mongo C ++驱动程序)执行这些命令:
sh.enableSharding("YourDB")
sh.shardCollection("YourDB.YourCollection", {field:hashed})
我已经搜索了3个小时但仍未找到方向。有什么想法吗?
答案 0 :(得分:1)
驱动程序不为此提供帮助程序,但您可以使用mongocxx::database::run_command
在enableSharding command手册中指定的参数调用服务器上的命令。