_newInstance
_newInstance
Utility method which concrete subclasses are expected to implement for creating a new instance of THIS concrete implementation from a Java cursor. Good with cursor calls that return a new cursor.
(DBCursor)
(this.type)
$explain
$explain
Sets a special operator of $explain which, if true, explains the query instead of returning results.
This is the same as calling the explain() method on the cursor.
(Boolean = true)
the same DBCursor, useful for chaining operations
$hint
$hint
Sets a special operator $hint which forces the query to use a given index.
This is the same as calling hint() on the cursor.
(DBObject)
the same DBCursor, useful for chaining operations
$max
$max
Sets maximum index bounds - commonly paired with $max
(DBObject)
the same DBCursor, useful for chaining operations
http://www.mongodb.org/display/DOCS/max+and+max+Query+Specifiers
$maxScan
$maxScan
Sets a special operator of $maxScan Which defines the max number of items to scan.
: Numeric
(A)
the same DBCursor, useful for chaining operations
$min
$min
Sets minimum index bounds - commonly paired with $max
(DBObject)
the same DBCursor, useful for chaining operations
http://www.mongodb.org/display/DOCS/min+and+max+Query+Specifiers
$orderby
$orderby
Sets a special operator of $orderby which defines the sort spec for this cursor.
This is the same as calling sort on the cursor.
(DBObject)
the same DBCursor, useful for chaining operations
$query
$query
Sets a special operator of $query Which defines the query for this cursor.
This is the same as running find() on a Collection with the query.
(DBObject)
the same DBCursor, useful for chaining operations
$returnKey
$returnKey
Sets a special operator of $returnKey If true, returns ONLY the index key. Defaults to true if you just call $returnKey
(Boolean = true)
the same DBCursor, useful for chaining operations
$showDiskLoc
$showDiskLoc
Sets a special operator $showDiskLoc which, if true, shows the disk location of results.
(Boolean = true)
the same DBCursor, useful for chaining operations
$snapshot
$snapshot
Sets a special operator of $snapshot which, if True, sets snapshot mode on the query.
This is the same as calling the snapshot() method on the cursor.
(Boolean = true)
the same DBCursor, useful for chaining operations
"Special" Operators for cursors
"Special" Operators for cursors
adds a special operator like $maxScan or $returnKey
the same DBCursor, useful for chaining operations
http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-Specialoperators { @inheritDoc}
batchSize
batchSize
Limits the number of elements returned in one batch.
(Int) The number of elements to return in a batch
the same DBCursor, useful for chaining operations
close
close
Kill the current cursor on the server
copy
copy
Creates a new copy of an existing database cursor. The new cursor is an iterator even if the original was an array.
The new cursor
count
count
The DBCursor's count of elements in the query, passed through from the Java object. Note that Scala Iterator[_] base trait has a count method which tests predicates and you should be careful about using that.
NOTE: count() ignores any skip/limit settings on a cursor; it is the count of the ENTIRE query results. If you want to get a count post-skip/limit you must use size()
Int indicating the number of elements returned by the query
size()
cursorId
cursorId
A long representing the cursorID on the server; 0 = no cursor
explain
explain
Returns an object containing basic information about the execution of the query that created this cursor. This creates an instance of CursorExplanation which is a custom dbObject with the key/value pairs: - cursor = Cursor Type - nscanned = Number of items examined by Mongo for this query - nscannedObjects = Number of objects examined by Mongo - n = the number of records which Mongo returned - millis = how long it took Mongo to execute the query - nYields = number of times this query yielded the read lock to let writes in - indexBounds = the index boundaries used.
CursorExplanation provides utility methods to access these fields.
an instance of CursorExplanation
http://dochub.mongodb.org/core/explain
hasNext
hasNext
Is there another element in the cursor?
(Boolean Next)
hint
hint
Provide the Database a hint of an indexed field of a collection to use to improve performance.
(String) The name of an index
the same DBCursor, useful for chaining operations
hint
hint
Provide the Database a hint of which indexed fields of a collection to use to improve performance.
A view of DBObject to use for the indexKeys
(A) A DBObject of the index names as keys
the same DBCursor, useful for chaining operations
limit
limit
Limits the number of elements returned.
NOTE: Specifying a negative number instructs the server to retrun that number of items and close the cursor. It will only return what can fit into a single 4MB response
(Int) The number of elements to return
A cursor pointing to the first element of the limited results
http://dochub.mongodb.org/core/limit
next
next
Iterator increment.
TODO: The cast to T should be examined for sanity/safety.
The next element in the cursor
numSeen
numSeen
Returns the number of objects through which this cursor has iterated, as tracked by the java driver.
The number of objects seen
Manipulate Query Options
Manipulate Query Options
Gets current option settings - see Bytes.QUERYOPTION_* for list
com.mongodb.Bytes
com.mongodb.Mongo
Manipulate Query Options
Manipulate Query Options
Adds an option - see Bytes.QUERYOPTION_* for list TODO - Create Scala version of Bytes.QUERYOPTION_*
com.mongodb.Bytes
com.mongodb.Mongo
Manipulate Query Options
Manipulate Query Options
Gets current option settings - see Bytes.QUERYOPTION_* for list
com.mongodb.Bytes
com.mongodb.Mongo
Manipulate Query Options
Manipulate Query Options
Sets current option settings - see Bytes.QUERYOPTION_* for list
com.mongodb.Bytes
com.mongodb.Mongo
Manipulate Query Options
Manipulate Query Options
Resets options to default.
com.mongodb.Bytes
com.mongodb.Mongo
skip
skip
Discards a given number of elements at the beginning of the cursor.
(Int) The number of elements to skip
A cursor pointing to the first element of the results
http://dochub.mongodb.org/core/skip
Use snapshot mode for the query.
Use snapshot mode for the query. Snapshot mode prevents the cursor from returning a document more than once because an intervening write operation results in a move of the document. Even in snapshot mode, documents inserted or deleted during the lifetime of the cursor may or may not be returned. Currently, snapshot mode may not be used with sorting or explicit hints.
the same DBCursor, useful for chaining operations
sort
sort
Sort this cursor's elements
A view of DBObject to sort by
(A) The fields on which to sort
A cursor pointing to the first element of the sorted results
Scala wrapper for Mongo DBCursors, including ones which return custom DBObject subclasses.
This is a rewrite of the Casbah 1.0 approach which was rather naive and unnecessarily complex.... formerly was MongoCursorWrapper
2.0, 12/23/10
2.0