Mongodb wrapper
Installation
npm install mongo-model
Documentation
Example.coffee
A basic database model
model: 'Fruit' @defaults handle: '' name: '' price: 0.00 description: '' images: models = Fruit: Fruit
Initialize database
db = 'testdata'models
Load all objects of model Fruit
= -> dbload 'Fruit' obj = objs0 consolelog objhandle obj.handle = 'test' consolelog objhandle consolelog errobj
Save an object
= f = name: 'Apple'handle: 'apple'db: db fsave callback
dbsetup -> save -> consolelog "saved" load