Method: PuppetDBQuery::MongoDB#initialize

Defined in:
lib/puppetdb_query/mongodb.rb

#initialize(connection, nodes = :nodes, node_properties = :node_properties, meta = :meta) ⇒ MongoDB

initialize access to mongodb

You might want to adjust the logging level, for example:

::Mongo::Logger.logger.level = logger.level

Parameters:

  • connection

    mongodb connection, should already be switched to correct database

  • nodes (defaults to: :nodes)

    symbol for collection that contains nodes with their facts

  • node_properties (defaults to: :node_properties)

    symbol for collection for nodes with their update timestamps

  • meta (defaults to: :meta)

    symbol for collection with update metadata



23
24
25
26
27
28
# File 'lib/puppetdb_query/mongodb.rb', line 23

def initialize(connection, nodes = :nodes, node_properties = :node_properties, meta = :meta)
  @connection = connection
  @nodes_collection = nodes
  @node_properties_collection = node_properties
  @meta_collection = meta
end