{"_id":"mongo-redline","_rev":"33-67cee20341a588cdf865e610537c59ed","name":"mongo-redline","description":"node.js thin mongodb document models library","dist-tags":{"latest":"0.2.3"},"versions":{"0.0.1":{"name":"mongo-redline","version":"0.0.1","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.0.1","dist":{"shasum":"43d54742d354ea3a119070cf93eb0bf7d4d68968","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.0.1.tgz","integrity":"sha512-BgO0XF+ldvZSI0kpOnbDN5clcvUmI6Ui+F1QhGDYZaZgjSSh44FnRsOFv5wEqjGw9ZvvAMWT23xZxKJLQzIOfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBlCbCcRwzTkA1zElrQprW5lq/Ltddgnle7xw49z0GCrAiBjOn6gCbdZMmNKgcWrFNxudU86qkfKBWgon2PbbMzPhg=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.0.2":{"name":"mongo-redline","version":"0.0.2","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.0.2","dist":{"shasum":"e4ab9ebd55311cfb14626958eb2346700a3d262d","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.0.2.tgz","integrity":"sha512-0IjhUQZFE/I+xoVHJ7BJ1XZmYh1QlKLSmwCV/dweu+CGCUhgxAKtbBSiXjHd11nXSdYM+4m6m+Lrby/H+sJELA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0Pfdrl+B+CByCVfdFzO/xyA4UmxsH28BPjeeF5p83aAiAD4lG2suAd0YJIc15fsZCdVPcYkStKBh0UtDuzGejJlg=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.0.3":{"name":"mongo-redline","version":"0.0.3","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.0.3","dist":{"shasum":"81a99322b05b2829d40d25994ced6a511cfc0c77","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.0.3.tgz","integrity":"sha512-+x2+ite1nftywmh5UtB77/b5opsWKnqLYcuCjpogp+umORXljTsTq0pOkUbllZ7aKzXgGrGal1W3AMDRZwa7rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDorjeYhO9SqjMSgt/DGi1P0w7uEIbJx6ggcQB2loV20gIhAOncM65mt36My29MnObx0Ics346veuKbd44PxmGS/jGS"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.0.4":{"name":"mongo-redline","version":"0.0.4","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.0.4","dist":{"shasum":"fcce1852a5eab61d3e2b4324d6524302ee85f74f","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.0.4.tgz","integrity":"sha512-Kux68BjjPwrjoXy9WKQohd6g1QKRVNqjwLTofr3CYQCOMqUhJM14MPQeP/XHNM/USz7PEBX93DNm3jBl2WIL5w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaNZI2YDTHYDEtDn1kTG3s9t00P/wRs2kT/xg+1N6B3QIgNmYvV9NupZ8WRNQrASNCHahM4AnDcr2j0lPFmaHgl2k="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.0.5":{"name":"mongo-redline","version":"0.0.5","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.0.5","dist":{"shasum":"cd200b3a3209d69526ad11b4e467697f5e1a3d30","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.0.5.tgz","integrity":"sha512-PIHOByT1/AlrvuVf2uXuAiCqLfd2SH+HV1U7FeXewAn9aIc/7xyzXBwpHMi3tIpHw0tPSqwVtneqxse3ViacwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDuLV4VONl7iXzYSVb88Hu3lvnKf1Nw9FC2OOj5ZxzasAiBePq+nNghmSaBuQ4HSyNgsmpBQiZK6PTROP8fbv9ko5Q=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.0.6":{"name":"mongo-redline","version":"0.0.6","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.0.6","dist":{"shasum":"2cce5e5cdee5fb0ecc4e721bc57888c0782c03e6","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.0.6.tgz","integrity":"sha512-+1ChmGq/WllV4/gUproFUBjF9bSV/EDCNywZ2URssiRUyEkor1Ccz1rFxAI0CO1G8QqlsuRYEm16PQ66RlJf8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMH/N0T+MXLMboBjDwjT0kkzN0uzQafwhDUYkXYrE/BQIhAMHRONAC08Su4oL7f9OjEZpZ3ercxdPPWsD0o34+YUtk"}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.1.1":{"name":"mongo-redline","version":"0.1.1","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"*","mongodb":"*"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"devDependencies":{"mocha":"latest","mocha-lcov-reporter":"latest","should":"latest","coveralls":"latest","jscoverage":"latest","jshint":"latest"},"scripts":{"test":"make test","coveralls":"make test-coveralls"},"license":"MIT","bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.1.1","dist":{"shasum":"30c2c36ed800fdad5f5f6e575be5d2b73890185c","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.1.1.tgz","integrity":"sha512-gSzgXd0J7crFEoZpNh0Bx0+K/Rw8B/4KQtskGUoQKbG7M9Q8TEaMFI3lzSn8zC26PDaVQnh0LfPoLb2DBubVqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICU4hn93BT7XJBDdhFJGD8ZYOMpyOfCrGKTTbY1HmO9kAiEAxhayNdQLD9vucZ4atqQWG/Pvsq1wtD1IiU++r12gMs4="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.2.0":{"name":"mongo-redline","version":"0.2.0","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"1.6.x","mongodb":"1.4.x"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"devDependencies":{"mocha":"latest","mocha-lcov-reporter":"latest","should":"latest","coveralls":"latest","jscoverage":"latest","jshint":"latest"},"scripts":{"test":"make test","coveralls":"make test-coveralls"},"license":"MIT","bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.2.0","dist":{"shasum":"1a436bb73d54b57ded1da281efb518a88e5d00d7","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.2.0.tgz","integrity":"sha512-mGXwb0hm+S/rG4b6Y0ZxaIJPP9ByH2mJiab/Eg3by9G9M81GAkiYwLH7yKqPBIEKpgCe1lPdXDgW95fKrezVwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGLfbasiUOoHx28Hdo/BzJZ/mOp70JD4AkxJBZr7c/HAiEApkF1md59O4N9zYAy/bFiYQnq3cHQo79e57ZkX74I5zc="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.2.1":{"name":"mongo-redline","version":"0.2.1","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"1.6.x","mongodb":"1.3.x"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"devDependencies":{"mocha":"latest","mocha-lcov-reporter":"latest","should":"latest","coveralls":"latest","jscoverage":"latest","jshint":"latest"},"scripts":{"test":"make test","coveralls":"make test-coveralls"},"license":"MIT","bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.2.1","dist":{"shasum":"2923b5da0e45184aeeb4186ff2135debc167231e","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.2.1.tgz","integrity":"sha512-ix7bw0+VR6+OQYvcljCwKxutxUaVnMXqf+UczRQlwINWXvTa7oTarOwIjWKBC4PaGjWVX3OJO3bdCjdMIJFKkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFxtunoUTN98DJhWCmfv55Be/vviGnQvvqmmY1jXvwQ9AiB9Paxt3Om72hJwikHmiPIUv1GWZZg4A8ORX99vdc2RzQ=="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}]},"0.2.2":{"name":"mongo-redline","version":"0.2.2","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"1.6.x","mongodb":"1.4.x"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"devDependencies":{"coveralls":"latest","gulp":"^3.8.8","gulp-mocha":"^1.0.0","gulp-util":"^3.0.1","jscoverage":"latest","jshint":"latest","mocha":"latest","mocha-lcov-reporter":"latest","should":"latest"},"scripts":{"test":"make test","coveralls":"make test-coveralls"},"license":"MIT","gitHead":"0420f2b05d71c337b1fb7b8cade376cadae5d381","bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.2.2","_shasum":"22dc1a1567bbc9870d4d6ca44a087d7f534d023e","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}],"dist":{"shasum":"22dc1a1567bbc9870d4d6ca44a087d7f534d023e","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.2.2.tgz","integrity":"sha512-QssESAEfqTprpgkXbZmKB6SICaZR2IUTmzpiFZzYoPxpoaEBbVcqdSDGLhRX51QHt0qrnOAVqRDxh7kGbOzR0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5wYV6sBFq0ZOpvV2c58C4vm/nAxOLQWdxWHD2BPTDTAiBR84YpVD+M6DPdN//TEMpNOq5qtOyh/PCD8B4Fmx00vQ=="}]}},"0.2.3":{"name":"mongo-redline","version":"0.2.3","description":"node.js thin mongodb document models library","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"keywords":["mongodb","model","document"],"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"dependencies":{"underscore":"1.6.x","mongodb":"1.3.x"},"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"devDependencies":{"coveralls":"latest","gulp":"^3.8.8","gulp-mocha":"^1.0.0","gulp-util":"^3.0.1","jscoverage":"latest","jshint":"latest","mocha":"latest","mocha-lcov-reporter":"latest","should":"latest"},"scripts":{"test":"make test","coveralls":"make test-coveralls"},"license":"MIT","gitHead":"692b141cc5008b92a1e7ca82fed62a158526f117","bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"homepage":"https://github.com/redpelicans/mongo-redline","_id":"mongo-redline@0.2.3","_shasum":"173dae6d0026b25541f47bb5a9e049510017b816","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"ebasley","email":"ebasley@gmail.com"},"maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}],"dist":{"shasum":"173dae6d0026b25541f47bb5a9e049510017b816","tarball":"https://registry.npmjs.org/mongo-redline/-/mongo-redline-0.2.3.tgz","integrity":"sha512-dlshaxvPtWnAMWBo4bA4nqWYGLxRA/Fmxqb1MFMumc4Nc9uZ93YxU+IoshDbawNEm7CSVn6mJq2AYCpBwCGXew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFROdXjRiDShNYMv+O/zZhBBuVgQUjtzjfxZu1fft5FGAiAUp6x4AG10TAvyFGND4JO9ayNm4xz9ovedCOncNkSRMA=="}]}}},"readme":"## mongo-redline [![Build Status](https://travis-ci.org/redpelicans/mongo-redline.png)](https://travis-ci.org/redpelicans/mongo-redline) [![Dependency Status](https://david-dm.org/redpelicans/mongo-redline.png)](https://david-dm.org/redpelicans/mongo-redline) [![Coverage Status](https://coveralls.io/repos/redpelicans/mongo-redline/badge.png?branch=master)](https://coveralls.io/r/redpelicans/mongo-redline?branch=master)\n\n\nmongo-redline is a very lite an simple Node.js library to connect to Mongodb and map documents with plain Javascript objects.\nIt's purely schemaless, fully compatible with official Mongo API and made like a toolkit to fit your needs, rather than a full functional framework like Mongoose.\nIt's only a read-only ODM, writes MUST be done manually.\nYou can use it just to connect to Mongo, it may not very useful, but could be efficient : use only one connection, callback made, so easily integrated with node.js and async.\nIf you look for a thin layer to define models in a non intrusive manner, it will give you the beginning of the answer ...\n\n\n### Usage\n\n#### Define a Model\n\n```javascript \nvar redMongo = require('mongo-redline')\n  , Mixin1 = require('mixin1');\n\nvar MyModel =  redMongo.defineModel({ \n\n  collection: 'my_models',\n\n  mixins: [Mixin1],\n\n  instanceMethods: {\n    get age(){\n      return (new Date()).getFullYear() -  this.birthdayYear;\n    }\n  },\n\n  staticMethods: {\n    function doIt(newModel){}\n  }\n\n});\n\n```\n\n#### Connect, Query and Manipule Objects\n\n\n```javascript \n\nvar redMongo = require('mongo-redline')\n  , myModel = require('my_model');\n\nredMongo.connect({}, function(err){\n  if( err) return console.error( \"...\");\n  // Query my_models collection\n  my_model.findOne({name: 'toto'}, function(err, model){\n    if(err)console.error(err);\n    else console.log(model.age)\n    redMongo.close();\n  });\n}\n```\n\n\n\n### API\n\n#### Connection\n\n##### redMongo.connect(options, cb)\n\nCreate a MongoDB connection, and callback it has result.\n\n* options *Object*, passed to `mongodb.Server` and `new mongodb.Db`\n\n  * `host`: server address, default to 127.0.0.1\n  * `port`: server's port, default to 27017\n  * `auto_reconnect`default to true\n  * `poolSize` default to 10\n  * ` w` default to 1\n  * `strict` default to true\n  * `native_parser` defaut to true\n\n\n#### Models\n\nCreate a new redMongo model. \n\nRedMongo models offer:\n\n* type definitions via redMongo models\n* a binding between collections and redMongo models\n* a binding at reading time between mongo's documents and javascript objets\n* facilities to query (findOne, findAll) documents based redMongo models and a bridge to mongodb API\n\n##### redMongo.defineModel(options)\n\nReturns a redModel.\n\n* options *Object*:\n\n  * `collection`: collection's name. May be optionnal for polymorphisme.\n  * `extends`: redMongo super model, default as redMongo.Model (see ex pieces.js)\n  * `mixins`: list of javascript objects to be used as mixins for the new model\n  * `instanceMethods`: javascript object used to define documents methods\n  * `staticMethods`: javascript object used to define `redModel` methods. Adding an entry within this object is similare to set a function attribute on the resulting redModel. 'init' key is reserved to define constructor (see below)\n\n`RedModel.bless`, defined within `staticMethods` or in an other manner, is used to 'type' mongo's document. At reading time each document is blessed depending on its collection. For polymorphism you have to do it manually (see below). \n\n\n```javascript \n\nvar Printable = {\n  toString: function(){\n    return this.type + ' => ' + this.surface;\n  },\n}\n\nvar Piece  = redMongo.defineModel({\n  collection: 'pieces',\n\n  mixins: [Printable],\n\n  staticMethods: {\n   \n    init: function(name){\n      this.name = name;\n      this.type = 'piece';\n    },\n\n    bless: function (obj){\n      switch( obj.type ){\n        case 'square':\n          return redMongo.Model.bless.bind(Square)(obj);\n        case 'circle':\n          return redMongo.Model.bless.bind(Circle)(obj);\n      default:\n       return redMongo.Model.bless.bind(Piece)(obj);\n      }\n    }\n  }\n});\n\nvar Square = redMongo.defineModel({\n  extends: Piece,\n\n  instanceMethods: {\n    get surface(){\n      return this.size * this.size;\n    }\n  },\n  staticMethods: {\n    init: function(size){\n      this.size = size;\n      this.type = 'square';\n    }\n  }\n});\n\n\n```\n\n##### redModel.findOne( arguments )\n\nUse same signature as `node-mongodb-native` driver. will call `redModel.bless(document)` on resulting document.\n\nReturn only one result, the first if many.\n\n\n```javascript \n  Piece.findOne({_id: ObjectId(\"52de8aa97a2731486fdcf8ee\")}, function(err, piece){});\n```\n\n##### redModel.findAll( arguments )\n\nSame as `node-mongodb-native`#find, but will call `redModel.bless(document)` on each resulting document.\n\n```javascript \n  Piece.findAll({type: 'square'}, function(err, pieces){});\n```\n\nIn this example, you will extract all squares documents from the collection, resulting documents will be blessed as Square. \n\n`Square.findAll()` will give you all Pieces, not only Squares. You have to select `type` manually.\n\n\n##### redModel.collection\n\nGive you direct access to `node-mongodb-native` driver:\n\n```javascript \n  Piece.collection.insert([new Square(2), new Circle(2)], function(err, res){})\n```\n","maintainers":[{"name":"ebasley","email":"ebasley@gmail.com"}],"time":{"modified":"2022-06-20T06:01:49.021Z","created":"2014-01-21T19:22:10.990Z","0.0.1":"2014-01-21T19:22:12.052Z","0.0.2":"2014-01-21T19:25:14.105Z","0.0.3":"2014-01-21T20:03:13.980Z","0.0.4":"2014-01-22T12:58:04.475Z","0.0.5":"2014-01-24T13:50:00.576Z","0.0.6":"2014-01-24T17:52:03.858Z","0.1.1":"2014-03-12T14:12:39.012Z","0.2.0":"2014-05-09T09:25:35.556Z","0.2.1":"2014-05-09T14:00:17.076Z","0.2.2":"2014-09-08T12:54:34.057Z","0.2.3":"2015-02-02T17:30:25.591Z"},"readmeFilename":"README.md","author":{"name":"Eric Basley","email":"ebasley@gmail.com"},"repository":{"type":"git","url":"git://github.com/redpelicans/mongo-redline.git"},"homepage":"https://github.com/redpelicans/mongo-redline","keywords":["mongodb","model","document"],"contributors":[{"name":"Eric Basley","email":"ebasley@gmail.com"}],"bugs":{"url":"https://github.com/redpelicans/mongo-redline/issues"},"license":"MIT","users":{}}