Sharding a collection is usually considered an administrative task that users would do once using the shell or another tool, so drivers don’t offer a helper for it. You can do this using db.RunCommand. The command document should be based on the information at https://docs.mongodb.com/manual/reference/command/shardCollection/. It would look something like this: