Class Mongo::Database::View
In: lib/mongo/database/view.rb
Parent: Object

A class representing a view of a database.

@since 2.0.0

Methods

Included Modules

Enumerable

Attributes

batch_size  [R]  @return [ Integer ] batch_size The size of the batch of results
  when sending the listCollections command.
collection  [R]  @return [ Collection ] collection The command collection.
limit  [R]  @return [ Integer ] limit The limit when sending a command.

Public Class methods

Create the new database view.

@example Create the new database view.

  View::Index.new(database)

@param [ Database ] database The database.

@since 2.0.0

Public Instance methods

Get all the names of the non-system collections in the database.

@example Get the collection names.

  database.collection_names

@param [ Hash ] options Options for the listCollections command.

@option options [ Integer ] :batch_size The batch size for results

  returned from the listCollections command.

@return [ Array<String> ] The names of all non-system collections.

@since 2.0.0

Get info on all the collections in the database.

@example Get info on each collection.

  database.list_collections

@return [ Array<Hash> ] Info for each collection in the database.

@since 2.0.5

[Validate]