Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92216

New aggregation stage to dump all collections of a sharded cluster

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 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.

       

            Assignee:
            silvia.surroca@mongodb.com Silvia Surroca
            Reporter:
            silvia.surroca@mongodb.com Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: