mongodb-like collections
var gumbo = ; var col = gumbo; col; //watching col;
API
gumbo.collection(source, modelClass)
creates a new collection
source
- the source for the collection.
modelClass
- the model class for the source.
Collection API
Iterator collection.insert(items)
Iterator collection.update(search, set)
Query collection.find(search)
Query collection.findOne(search)
Query collection.watch(search, observers)
watches the collection for any particular changes
Synchronizer collection.syncTo(targetCollection)
synchronizes the data from one collection to another collection
Iterator API
basic example:
//update, and return the modified itemscollection;
iterator.chunkSize(count)
defines the chunk size when executing asynchronous tasks
iterator.capture()
captures any found / modified items
iterator.exec(cb)
executes the iterator asynchronously
Array iterator.sync()
exetures the iterator synchronously, and returns the result