-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
CAR Team 2024-07-22, CAR Team 2024-08-05, CAR Team 2024-08-19, CAR Team 2024-09-02
Create a new aggregation stage called $listCollections to dump the list of collections in a sharded cluster.
> db.getSiblingDB("admin").aggregate([{$listCollections: {}}])
This is the list of fields that will be reported per every collection:
ns | string | The namespace of the collection. |
db | string | The database of the collection. |
uuid | UUID | The UUID of the collection. |
type | string | Possible values: “collection”/”view”/”timeseries” (same output as listCollections) |
idIndex | BSON object | (same output as listCollections) |
options | BSON object | (same output as listCollections) |
info | BSON object | (same output as listCollections) |
sharded | boolean | Specifies if the collection is sharded or unsharded. |
shardKey | (opt) BSON object | The shard key of the collection. Only present if the collection is sharded. |
- is depended on by
-
SERVER-93383 Test readOnly parameter on listCollections and $listCollections
- Backlog
-
SERVER-92961 Extend the response of $listCollections with additional fields
- Closed
-
SERVER-93136 Set timeseries options to the timeseries view docs got from $listCollections
- Closed
- is duplicated by
-
SERVER-95258 Create a new aggregation stage to list all the collections of a cluster
- Closed