humblejs
HumbleDB for Javascript
Last updated 5 months ago by nigelkibodeaux .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install humblejs 
SYNC missed versions from official npm registry.

HumbleJS - MongoDB ODM for Javascript

HumbleJS is the sister project of HumbleDB, a MongoDB ORM for Python. HumbleJS tries to maintain API parity with HumbleDB where at all possible, and when it makes sense, extends the API for convenience and clarity in JavaScript and CoffeeScript.

HumbleJS is written in CoffeeScript, but compiled and distributed as JavaScript.

Build Status Dependencies

Currently HumbleJS is stable in core features, but under development as nice-to-have features are added regularly. Documentation is a work in progress.

Documentation

Documentation is available on Read The Docs.

Quickstart

HumbleJS is available on npm.

Instaling HumbleJS...

$ npm install humblejs

And working with HumbleJS makes code clear, concise and readable...

var humblejs = require('humblejs');

// Create a new database instance
var my_db = new humblejs.Database('mongodb://localhost:27017/my_db');

// Use the document factory to declare a new Document subclass
var MyDoc = my_db.document('my_docs_collection', {
    doc_id: '_id',
    value: 'val',
    default: ['def', true],
    meta: humblejs.Embed('meta', {
        author: 'auth',
        created: 'created'
    })
});

// A document maps attribute names to document keys for clean, readable code
var doc = new MyDoc();
doc.doc_id = 'example';
doc.value = 1;
doc.meta.author = "Jimmy Page";
doc.meta.created = new Date();

// Documents have convenience methods for saving, inserting, and removing
doc.save(function (err) {
    console.log("Document saved:\n", doc);
    /*
    Document saved:
     { _id: 'example',
       val: 1,
       meta:
        { auth: 'Jimmy Page',
          created: Tue Nov 11 2014 13:11:05 GMT-0800 (PST) } }
    */
});

// Document classes have convenience methods for querying, updating, etc.
MyDoc.find({doc_id: 'example'}, function (err, docs) {
    if (err) throw err;
    // Do something with docs here, which will be an array
});

Changelog

See the releases for changes by version.

Contributors

License

MIT - See LICENSE

Current Tags

  • 2.2.3                                ...           latest (5 months ago)

32 Versions

  • 2.2.3                                ...           5 months ago
  • 2.2.2                                ...           a year ago
  • 2.2.1                                ...           a year ago
  • 2.2.0                                ...           3 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.0.15                                ...           6 years ago
  • 0.0.14                                ...           6 years ago
  • 0.0.13                                ...           6 years ago
  • 0.0.12                                ...           6 years ago
  • 0.0.11                                ...           6 years ago
  • 0.0.10                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |