gumbo
node.js db
Last updated 13 years ago by architectd .
Repository · Original npm · Tarball · package.json
$ cnpm install gumbo 
SYNC missed versions from official npm registry.

mongodb-like collections Build Status

var gumbo = require("gumbo");


var col = gumbo.collection([
	{
		name: "craig",
		age: 99
	},
	{
		name: "tim",
		age: 104
	}
}
]);

col.find({ age: { $gt: 100 } }).limit(10).skip(1).sort({ age: -1 }).exec(function(err, people) {
	
});


//watching 
col.watch({ age: {$gt: 100 } }, {
	insert: function(item) {
		console.log("insert %s", item.get("_id"));
	},
	update: function(item) {

	},
	remove: function(item) {

	}
});


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 items
collection.update({ name: "craig" }, { $set: { age: 55 }}).capture().exec(function(err, modifiedItems) {
	
});


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

Current Tags

  • 0.5.9                                ...           latest (13 years ago)

26 Versions

  • 0.5.9                                ...           13 years ago
  • 0.5.6                                ...           13 years ago
  • 0.5.4                                ...           13 years ago
  • 0.5.3                                ...           13 years ago
  • 0.5.1                                ...           13 years ago
  • 0.4.6                                ...           13 years ago
  • 0.4.5                                ...           13 years ago
  • 0.4.4                                ...           13 years ago
  • 0.4.3                                ...           13 years ago
  • 0.4.2                                ...           13 years ago
  • 0.2.2                                ...           13 years ago
  • 0.2.1                                ...           13 years ago
  • 0.2.0                                ...           13 years ago
  • 0.1.3                                ...           14 years ago
  • 0.1.2                                ...           14 years ago
  • 0.1.1                                ...           14 years ago
  • 0.1.0                                ...           14 years ago
  • 0.0.10                                ...           14 years ago
  • 0.0.9                                ...           14 years ago
  • 0.0.8                                ...           15 years ago
  • 0.0.7                                ...           15 years ago
  • 0.0.6                                ...           15 years ago
  • 0.0.5                                ...           15 years ago
  • 0.0.3                                ...           15 years ago
  • 0.0.2                                ...           15 years ago
  • 0.0.1                                ...           15 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 24
Last Day 0
Last Week 25
Last Month 2
Dependencies (13)
Dev Dependencies (2)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |