Method: Moped::Query#hint

Defined in:
lib/moped/query.rb

#hint(hint) ⇒ Query

Apply an index hint to the query.

Examples:

Apply an index hint.

db[:people].find.hint("$natural" => 1)

Parameters:

  • hint (Hash)

    The index hint.

Returns:

Since:

  • 1.0.0



138
139
140
141
142
# File 'lib/moped/query.rb', line 138

def hint(hint)
  upgrade_to_advanced_selector
  operation.selector["$hint"] = hint
  self
end