Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3918

Document the listCollections command

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • v1.3.14, mongodb-3.0
    • None
    • manual
    • None

    Description

      See SERVER-2442

      Example usage:

      > show collections
      fts_index3
      search
      system.indexes
       
      //
      // plain listCollections
      //
      > db.runCommand('listCollections');
      {
      	"collections" : [
      		{
      			"name" : "fts_index3",
      			"options" : {
      				"flags" : 1
      			}
      		},
      		{
      			"name" : "search",
      			"options" : {
      				"flags" : 1
      			}
      		},
      		{
      			"name" : "system.indexes",
      			"options" : {
      				
      			}
      		}
      	],
      	"ok" : 1
      }
       
      //
      // listCollections with a filter parameter ('fts_index3' has been filtered)
      //
      > db.runCommand('listCollections', {filter: {name: /^s/}});
      {
      	"collections" : [
      		{
      			"name" : "search",
      			"options" : {
      				"flags" : 1
      			}
      		},
      		{
      			"name" : "system.indexes",
      			"options" : {
      				
      			}
      		}
      	],
      	"ok" : 1
      }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 9 weeks ago