Skip to content

Latest commit

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

#resourceful-mongo Build Status

A MongoDB engine for resourceful, a datamapper part of the flatiron project.

Credits

Ryan Fitzgerald, Follow @TheRyanFitz on Twitter.

Warning

This project is in a very early stage, with limited functionality. Don't use in production.

Example

varresourceful=require('resourceful-mongo');//Define the resourcesvarPerson=resourceful.define('person',function(){this.use('mongodb',{uri: "mongodb://localhost/databaseName",// required - the mongo URI of the databasecollection: "people",// required - the name of the collectionsafe: true// optional - run the driver in safe mode to ensure that the update succeeded. Defaults to false});this.string('name');this.number('age');});varFlower=resourceful.define('flower',function(){this.use('mongodb',{//The mongo URI can also be defined piecemealhost: "localhost",database: "databaseName",collection: "flowers",safe: true});this.string('color');this.number('petals');});//Open the mongodb connectionresourceful.use('mongodb',{uri: "mongodb://localhost/databaseName",// required - the connection to be openedonConnect: function(err){// required - the callback upon opening the database connectionif(!err)app.start(8000);}});

Installation

Installing npm (node package manager)

 $ curl http://npmjs.org/install.sh | sh

Installing resourceful

 $ [sudo] npm install resourceful-mongo

Tests

All tests are written with mocha and should be run with npm:

 $ npm test

License: Apache 2.0

About

resourceful mongodb engine

Resources

Stars

21 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages