mongo v0.5.4 Mongo.Find

Find operation on MongoDB

Summary

Functions

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

Runs the explain operator that provides information on the query plan

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

Creates a new find operation

Sets query options

Sets where MongoDB begins returning results

Functions

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.

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

opts(find, options)

Sets query options

Defaults option set is equivalent of calling:

Find.opts(
  awaitdata: false
  nocursortimeout: false
  slaveok: true
  tailablecursor: false)
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