'collection.shards(details)' method return all the available shards for the collection.
If the argument ‘details’ is set to false, then this method return the array of shard names.
If details is set to true, then this method returns an object with the shard names as object attribute keys, and the responsible servers as an array mapped to each shard attribute key.
Note
The shards() method only used on Coordinators in clusters.
Example
db.test.shards()
db.test.shards(true)
Previous Next Home
No comments:
Post a Comment