mabolo
Just a simple ORM of MongoDB API.
Last updated 4 years ago by jysperm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mabolo 
SYNC missed versions from official npm registry.

Mabolo

Just a simple ORM of MongoDB API.

这个东西还是非常好的嘛!—— Master Yeechan
和 Mongoose 各有千秋。—— orzFly

Travis-CI NPM Version NPM Downloads

Features

Define Schema and validate document

User = mabolo.model 'User',
  username:
    type: String
    required: true

  age:
    type: Number
    default: 18

  password: String

Define model methods and document methods

User.findByName = (name, options...) ->
  return @findOne name: name, options...

User::getName = ->
  return @username

Support embedded document or array

Token = mabolo.model 'Token',
  code: String

User = mabolo.model 'User',
  tokens: [Token]

Promise style and callback style API

User.create
  name: 'jysperm'
.then (jysperm) ->

User.create
  name: 'jysperm'
, (err, jysperm) ->

Modify document atomically

jysperm.modify (jysperm) ->
  Q.delay(1000).then ->
    jysperm.age = 19
.then ->

Current Tags

  • 0.3.5                                ...           latest (4 years ago)

12 Versions

  • 0.3.5                                ...           4 years ago
  • 0.3.4                                ...           5 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.3.0-rc.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (8)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |