classafMorphia::MorphiaCur

sys::Obj
  afMorphia::MorphiaCur

Morphio Cursors wrap Mongo cursors to return entity objects.

bsonConvs

Source

BsonConvs bsonConvs

Used to convert BSON documents to Fantom objects.

each

Source

Void each(|Obj,Int fn)

Iterates over all remaining and unread documents.

This cursor is guaranteed to be killed.

cursor.each |Obj entity, Int index| {
    ...
}
isAlive

Source

Bool isAlive()

Returns true if the cursor is alive on the server or more documents may be read.

kill

Source

Void kill()

Kills this cursor.

No more entities will be returned from next(), each(), or toList().

make

Source

new make(MongoCur mongoCur, Type type, BsonConvs bsonConvs)

Creates a new Morphia Cursor.

map

Source

Obj?[] map(|Obj,Int->Obj? fn)

Converts all remaining and unread documents to a List. The new list is typed based on the return type of the function.

This cursor is guaranteed to be killed.

list := cursor.map |Obj entity, Int index -> Obj?| {
    ...
}
mongoCur

Source

MongoCur mongoCur { private set }

The backing Mongo cursor.

Source

Obj? next()

Returns the next entity from the cursor, or null.

The cursor must be manually killed.

while (cursor.isAlive) {
    entity := cursor.next
    ...
}
cursor.kill
toList

Source

Obj[] toList()

Return all remaining and unread entities as a List.

This cursor is guaranteed to be killed.

type

Source

Type type

The Fantom type that objects are returned as.