A wrapped cursor with inline decompression.

Constructor

Cursor ( ) {

Arguments

| mongodb.Cursor mongoloid

Native MongoDB cursor to wrap.

Instance Properties

Instance Methods

close ( ) {

Close the cursor session and abandon selected documents on the database.

Arguments

count (
[ doSkip ] ,
) {

Retrieve the number of selected documents.

Arguments

optional
| Boolean doSkip

Apply skip and limit options before counting.

each ( ) {

Iterate over every selected document.

Arguments

callback ( ) {

Arguments

| Object | undefined rec

If all documents have been consumed, rec is undefined.

explain ( ) {

Requests a metadocument of processing info for this query. Index names containing underscores are assumed to be of the format generated automatically by MongoDB and an attempt will be made to decompress key names.

Arguments

nextObject ( ) {

Retrieve the next single document.

Arguments

callback ( ) {

Arguments

| Object | undefined rec

If all documents have been consumed, rec is undefined.

rewind ( ) {

Rewind this cursor to the first selected document.

toArray ( ) {

Assemble every selected document into an Array. Note that using toArray carelessly is an excellent way to run a process out of memory.

Arguments