How to enable sharding for all databases/collections by default We are doing sharding process for 6 servers which includes 1 master process, 2 config process, 6 sharding processes.
We enabled the sharding by doing sh.enableSharding(database_name) and sh.shardCollection('mydb.collection_name', {_id: hashed}) It worked.
Now, if i add any other database/collection to the cluster, is there any way that, the database/collection get sharded automatically.
Answer is simple. NO!
Every DB and collection in them, must be shard individually. Just because all collections are not created as equal and _id: hashed is not best solution to everything.