Class: Mongo::Collection::View::Builder::OpQuery

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/mongo/collection/view/builder/op_query.rb

Overview

Builds a legacy OP_QUERY specification from options.

Since:

  • 2.2.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view) ⇒ OpQuery

Create the new legacy query builder.

Examples:

Create the query builder.

QueryBuilder.new(view)

Parameters:

Since:

  • 2.2.2



39
40
41
42
# File 'lib/mongo/collection/view/builder/op_query.rb', line 39

def initialize(view)
  @view = view
  @modifiers = Modifiers.map_server_modifiers(options)
end

Instance Attribute Details

#modifiersBSON::Document (readonly)

Returns modifiers The server modifiers.

Returns:

  • (BSON::Document)

    modifiers The server modifiers.

Since:

  • 2.2.0



29
30
31
# File 'lib/mongo/collection/view/builder/op_query.rb', line 29

def modifiers
  @modifiers
end

Instance Method Details

#specificationObject

Since:

  • 2.2.0



44
45
46
47
48
49
50
51
52
# File 'lib/mongo/collection/view/builder/op_query.rb', line 44

def specification
  {
    :selector  => requires_special_filter? ? special_filter : filter,
    :read      => read,
    :options   => query_options,
    :db_name   => database.name,
    :coll_name => collection.name
  }
end