Mongo.Find

Find operation on MongoDB

Source

Summary

addSpecial(find, k, v)
exec(find)

Executes the query and returns a %Mongo.Cursor{}

explain(find)

Runs the explain operator that provides information on the query plan

hint(f, hints)

Add hint opperator that forces the query optimizer to use a specific index to fulfill the query

new(collection, jsString, projector)

Creates a new find operation

opts(find, options)

Sets query options

skip(find, skip)

Sets where MongoDB begins returning results

Functions

addSpecial(find, k, v)
Source
exec(find)

Executes the query and returns a %Mongo.Cursor{}

Source
explain(find)

Runs the explain operator that provides information on the query plan

Source
hint(f, hints)

Add hint opperator that forces the query optimizer to use a specific index to fulfill the query

Source
new(collection, jsString, projector)

Creates a new find operation.

Not to be used directly, prefer Mongo.Collection.find/3

Source
opts(find, options)

Sets query options

Defaults option set is equivalent of calling:

Find.opts(
  awaitdata: false
  nocursortimeout: false
  slaveok: true
  tailablecursor: false)
Source
skip(find, skip)

Sets where MongoDB begins returning results

Must be run before executing the query

iex> Mongo.connect.%@m{"test"}.collection("anycoll").find.skip(1).toArray |> Enum.count
5
iex> Mongo.connect.%@m{"test"}.collection("anycoll").find.skip(2).toArray |> Enum.count
4
Source