Hello, welcome to the MongoDB community.

When you create a user in a sharded cluster, you will create it from mongos and it will store the user in the admin database of the config servers.

If you want to create a “local” user for that specific shard, you will need to log into the primary node of the shard and create the user, in which case it will store the user in the shard’s admin database.

Here is some documentation that may help you.

I am at your disposal.

Att,
Samuel

4 Likes