class Mongo::Operation::Commands::ListCollections

A MongoDB listCollections command operation.

@example Create the listCollections command operation.

Mongo::Operation::Read::ListCollections.new(db_name: 'test')

@note A command is actually a query on the virtual '$cmd' collection.

Initialization:

param [ Hash ] spec The specifications for the command.

option spec :db_name [ String ] The name of the database whose list of
  collection names is requested.
option spec :options [ Hash ] Options for the command.

@since 2.0.0

Private Instance Methods

selector() click to toggle source
# File lib/mongo/operation/commands/list_collections.rb, line 38
def selector
  (spec[SELECTOR] || {}).merge(
    listCollections: 1, filter: { name: { '$not' => /system\.|\$/ }}
  )
end