0.2.0 • Published 8 years ago

zealot v0.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

Zealot

A futurist MongoDB library. Only works with NodeJS 7+.

Installation

npm install --save zealot

Usage

const zealot = require('zealot')

zealot.open('localhost/test') // open the mongodb connection

// dispatch db.collection('users').findOne({username: 'foo'})
const user = await zealot.users.findOne({username: 'foo'})

// dispatch db.collection('users').update({_id: user._id}, {$set: {username: 'bar'}})
await (zealot.users[user._id].username = 'bar')
// or
await (zealot.users[user._id].update({$set: {username: 'bar'}}))
// or
await (zealot.users.update({_id: user._id}, {$set: {username: 'bar'}}))

// dispatch db.collection('users').update({_id: user._id}, {$unset: {temp: ''}})
await (delete zealot.users[user._id].temp)

// dispatch db.collection('users').deleteOne({_id: user._id})
await (delete zealot.users[user._id])

// dispatch db.collection('users').drop()
await (delete zealot.users)

Licence

MIT

0.2.0

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

1.0.4

10 years ago