0.0.1 • Published 9 years ago
happ-mongo v0.0.1
HAPP-Mongo
Databases & collections
var db = $.mongo({
host: 'localhost',
db: 'aeeauto'
});
var users = db.list('users');
var lists = db.lists(['users', 'files', 'images']);
List methods
users.create({
username: 'mike',
email: 'mike@gmail.com'
}).then(function (user) {
// ...
});
users.filter({
email: 'mike@gmail.com'
}).then(function (users) {
// ...
});
users.get({
email: 'mike@gmail.com'
}).then(function (user) {
// ...
});
users.remove({
email: 'mike@gmail.com'
}).then(function (count) {
// ...
});
Item methods
user.save({
email: 'new@email.com'
}).then(function (user) {
// ...
});
user.remove().then(function () {
// ...
});
0.0.1
9 years ago