{"_id":"mongodb-wrapper","_rev":"40-0fbdf924de69f86d26cec6ca96a8d16a","name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","dist-tags":{"latest":"1.0.3"},"versions":{"0.1.0":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.1.0","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.x"},"directories":{"lib":"lib"},"devDependencies":{},"_id":"mongodb-wrapper@0.1.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"dcf835ce162309e598dd5996992d534198d155b4","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.1.0.tgz","integrity":"sha512-2d1aY+Mvi6bRxNjvfA9ryXQN5FTz1SgsXZNrtxauQU50E763nc4kq6ebaJhLxq+VjK7dQmg9HFzU3wkhrx77vg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5cU3shz/VQxO0PtmElbjuA9IElNsYAVKjNXtUqDjDdQIhAL3mCH/BPYoqgeqvtPyi09mSH8FQ3KL+YBOv5qakc0Ms"}]},"scripts":{}},"0.1.1":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.1.1","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.x","async_testing":"0.3.2"},"directories":{"lib":"lib"},"devDependencies":{},"_id":"mongodb-wrapper@0.1.1","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"a266641b248c05109b8f40bd3e9d73aaafdd87e1","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.1.1.tgz","integrity":"sha512-GtQeO4q6frV1H8bEO8pKZJZLPp2ckzxfOM2pDzATahuffWI/JSIWyZ/bOveAZOnd3F4WHavpG7h8PPdxAkKlhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRpbtQbG+fZA9+MWpyVGa3dH7akrVU8EcwXXuerg5myAiB9PW1G9KW3MjGPE4d8B5J9bhqgpyDeagisXM90AIdMig=="}]},"scripts":{}},"0.2.0":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.0","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.x","async_testing":"0.3.2"},"directories":{"lib":"lib"},"devDependencies":{},"_id":"mongodb-wrapper@0.2.0","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"765129342a606349282c3b239f1f1fa92c80cd69","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.0.tgz","integrity":"sha512-846iIGqwt6Eb6I+pYv/do8wL4V+DD3EJCccYXBr/uUCHjRwUbqJZaX0IJu1cTzjLtVqHxb3K/2qX6EcpY4qUbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfO9h8bOgYsMc/UutknCL0eFEhDLwasKkDtQl+mgUSIAIhAPeZR8f1V1eRgsvDT6AjdppT0xle+5np7Np/60Uk694g"}]},"scripts":{}},"0.2.1":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.1","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.x","async_testing":"0.3.2"},"directories":{"lib":"lib"},"devDependencies":{},"_id":"mongodb-wrapper@0.2.1","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"d8a1ab7fed8d21d982cc3a8cff2e21ab1f60aee9","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.1.tgz","integrity":"sha512-aqcbQB4YyO/phzQivVgDiIODsWj4VjRC25hnFDsZXO8htkIq0XjqtkuKqwU4cB+W1n+cj9/rqEmTvPJ9kHBuvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZw1uHXjPddPdEqm5hGkFrwJEhGQvdbOa7baoVhJQ9aAIhALDGdGsc31+r/RpCX9DXHUMCmiCLtQrhsmmpjTgTqrRa"}]},"scripts":{}},"0.2.2":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.2","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.x","async_testing":"0.3.2"},"directories":{"lib":"lib"},"devDependencies":{},"_id":"mongodb-wrapper@0.2.2","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"0861615ae4287d4a14ee0271f354bd5e93a04182","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.2.tgz","integrity":"sha512-AFlsLoLHwIpPknO2SmxhRuuGlyqEOTEqt5Tj6EE5Dbqm6bplsjo5PLd1uN8BauoEuMOGLB2s2pEgwJ4idMz2ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTdDbtzDeGtv6D/o8EasXMTLlZv2fOhD/YwVI0qUnJQAiALJVyt43tMHizdJeRKnCeiif9+XB0lU6t1pOCFJC6YkA=="}]},"scripts":{}},"0.2.3":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.3","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.x","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_npmJsonOpts":{"file":"/Users/seanhess/.npm/mongodb-wrapper/0.2.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mongodb-wrapper@0.2.3","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"198cafedda4ecdb52b0fe3739f5be0974b2cd0ed","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.3.tgz","integrity":"sha512-qpDp68grmnFmAo8wkG3LCCJZF7kaL0+2Ib7HPeHAWisHoOGWh+Z2wKgM+jolPk4x/Ri8GaAPy1ECUxSyAf2V+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzPrielgYYi9s2BFxA6MJSgS9GgbAxNBUGPUR7Qy7A8AiEAkEd8u2RnW3V4RIfj87YW+hJC0O44eLAUdQFpnaebhH0="}]},"scripts":{}},"0.2.4":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.4","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.6-23","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_npmUser":{"name":"seanhess","email":"seanhess@gmail.com"},"_id":"mongodb-wrapper@0.2.4","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"aa4ef08fdc2d10ceac4be779c3bd0c3a96fb7ceb","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.4.tgz","integrity":"sha512-S/QzT+tvY8xroVCF9o5VCFdaGtUJrhWSgPan6fE4c+P4MRnLGpN9/7x/4x49PPlIEL4OCSWQEpSqpBbmrgY4Nw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCH3vWx+DrBs3GXinju3x9HZGZJWr84uPKFPVGuPwXF68CIER4o6ckIPpdjmHBmIkue2yD0/YRnu4WeHu48RGj1AIa"}]},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"}]},"0.2.5":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.5","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.6-23","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_npmUser":{"name":"seanhess","email":"seanhess@gmail.com"},"_id":"mongodb-wrapper@0.2.5","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"5fb32049729b39ba6d0a5ee660c0278a0712cdb1","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.5.tgz","integrity":"sha512-3ewUH2qtR2+/eBPMsQNCORDBiIcriZ7iDBpxOQC+7Kj8vYwUbcDhTk8HaDrJw29bbwZ5BopBSG3Q2/Um70v5tQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICiYb1SnwSnBfEBhcZ6iKIcu9jt4xe21pIKwlevIn7foAiEAiCKPjxElhcfxIjOHJt0rRL5axsKWVjpxTDkvNABmvj8="}]},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"}]},"0.2.6":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.6","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":"0.4.x"},"dependencies":{"mongodb":"0.9.6-23","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_npmUser":{"name":"seanhess","email":"seanhess@gmail.com"},"_id":"mongodb-wrapper@0.2.6","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"47954fcfb04d480593757221a2be5c7598c14d60","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.6.tgz","integrity":"sha512-LMCQr/BXwrKp2eT4QvI+EZGwiDKv1NbhEf2l0uD96iBxduj3wtp5vdl1r60Q0HBlIkkgO78V/mNHrpd+dkw/TQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrgnvPKc60hxSpeuxnTXcHZX/VkwceCt1iwPSfuZenSgIhAJYKeEeGlAL4FLkAqov74TB+GdgDrZWHq2XkdLL5xOPN"}]},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"}]},"0.2.7":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.2.7","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","keywords":["mongodb"],"engines":{"node":">= 0.4.0"},"dependencies":{"mongodb":"0.9.6-23","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_npmUser":{"name":"seanhess","email":"seanhess@gmail.com"},"_id":"mongodb-wrapper@0.2.7","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"f73bcb03cae8ff400f3cb5223933399876886663","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.2.7.tgz","integrity":"sha512-/bV4NVh3faU3BLyRABAs2TT99tOjkQuQbO2Gtw/SOEAtOvcwqF3RAApgyGvgHMrzaIqUn5+28vihMoCWjRevYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC+Jw2m9EurG1vC9V1NIWoCnDraVv2S6c25stJH8olpOAiBdltH6cZChZ+GF+JjACGyz6gWWLoKC56DlKzMFxMyyQQ=="}]},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\nYes, we know other people are doing the same thing. This one has been easier to use. \n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual](http://www.mongodb.org/display/DOCS/Manual)\n2. Lazy open/close of connections\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Features it doesn't have\n\n1. Connection pooling. Each db will share a single connection. \n\n## Installation\n\n<pre>\n  npm install mongodb-wrapper\n</pre>\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n<pre>\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n</pre>\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n\n\n","maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"}]},"0.3.0":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.3.0","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","scripts":{"test":"node test.js"},"keywords":["mongodb"],"engines":{"node":">= 0.6.0"},"dependencies":{"mongodb":"0.9.9-8","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_npmUser":{"name":"seanhess","email":"seanhess@gmail.com"},"_id":"mongodb-wrapper@0.3.0","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.15","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"1d6819da8510cd7daf7b8c101b24696ca765028c","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.3.0.tgz","integrity":"sha512-8SyJDN+eTMdYRDuJGOdAhaasqEKtmR7cSij/mi+d6gZGHK/Fy9OeoxjiEHFJQQ9ENc8H64Pr/sy9WZLTDDH9/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtIz1fVaMIR1z+AjnKE6fYLeBNZ8SSDxrN392PUV6eIAiEAkPD9x6OASokA/SQasFHFnJEBmHCjkHEy0JGOJsmM5tA="}]},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n[docs]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\nYes, we know other people are doing the same thing. This one has been easier to use. \n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual][docs]\n2. Lazy open/close of connections\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Installation\n\n<pre>\n  npm install mongodb-wrapper\n</pre>\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n<pre>\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n</pre>\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n## Documentation\n\nRemember the guiding principle: the syntax exactly matches the [command-line driver][docs], except you pass a call back to any funciton that hits the database. \n\n#### Connecting\n\n`mongo.db(host, port, dbname, [prefix], [username], [password])` - returns an unopened database object. \n* If prefix is specified all collections will use the prefix in mongo, but you refer to them without the prefix in node. \n* If username and password are specified, it will attempt to authenticate. \n\n`db.collection(name)` - Returns a `Collection` object. Also creates `db[name]` so you can do this:\n    \n    db.collection('user')\n    db.users.count(cb)\n\n\n#### Authentication\n\n`db.auth(username, password, cb)` - You can pass `username` and `password` into mongo.db instead of calling this manually\n\n`db.addUser(username, password, cb)`\n\n`db.removeUser(username, password, cb)`\n\n#### Database \n\n`db.dropDatabase(cb)`\n\n`db.lastError(cb)` - `cb(err, lastError)`\n\n`db.eval(code, [parameters], cb)`\n\n`db.createCollection(name, options, cb)` - allows you to create a collection by hand if you want to specify the options\n\n### Collection\n\n`collection.ensureIndex(index, options, cb)`\n\n`collection.dropIndexes(cb)`\n\n`collection.renameCollection(newName, dropTarget, cb)`\n\n`collection.insert(doc(s), cb)`\n\n`collection.remove(selector, cb)`\n\n`collection.drop(cb)`\n\n`collection.save(doc, cb)`\n\n`collection.update(selector, updates, [upsert], [multi], cb)`\n\n`collection.count(cb)`\n\n`collection.findAndModify(options, cb)`\n\n`collection.find(selector, fields)` - Returns a `Cursor`\n\n`collection.findOne(selector, fields, cb)`\n\n`collection.group(options, cb)`\n\n`collection.mapReduce(map, reduce, options, cb)` - map and reduce can be functions, it will toString them for you. \n\n`collection.distinct(key, [query], cb)`\n\n### Cursor\n\n`cursor.limit(num)` \n\n`cursor.skip(num)`\n\n`cursor.sort({field:1})`\n\n`cursor.next(cb)`\n\n`cursor.explain(cb)`\n\n`cursor.toArray(cb)`\n\n`cursor.count(cb)`\n\n### Useful Exports\n\n`mongo.ObjectID` - you need to wrap any string ids in this class to match on `_id`\n\n","maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"}]},"0.4.0":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"0.4.0","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","scripts":{"test":"node test.js"},"keywords":["mongodb"],"engines":{"node":">= 0.6.0"},"dependencies":{"mongodb":"0.9.9-8","async_testing":"0.3.2"},"directories":{"lib":"lib"},"_id":"mongodb-wrapper@0.4.0","dist":{"shasum":"5c733b0c70ceba990dd8947673d00e6ed6c68b19","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-0.4.0.tgz","integrity":"sha512-132SaNn8yXBmUFnRUDCKMqf65iIzNMe+palKojSU3ShqaEJoUO0mzvi+PQG+SA8X1F0MkC45Ste0y0erC05efg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFX8jnxtupafs9ffu9egryLmh14sya9m5Cw8TG6bb+YkAiEAp3e2P2xc4dFXwqmpSRrCEW3hTBicNua0NJ9Hmyt+Zo4="}]},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n[docs]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\nYes, we know other people are doing the same thing. This one has been easier to use. \n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual][docs]\n2. Lazy open/close of connections\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Installation\n\n<pre>\n  npm install mongodb-wrapper\n</pre>\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n<pre>\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n</pre>\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n## Documentation\n\nRemember the guiding principle: the syntax exactly matches the [command-line driver][docs], except you pass a call back to any function that hits the database. \n\n#### Connecting\n\n`mongo.db(host, port, dbname, [prefix], [username], [password])` - returns an unopened database object. \n\n* If prefix is specified all collections will use the prefix in mongo, but you refer to them without the prefix in node. \n* If username and password are specified, it will attempt to authenticate. \n\n`db.collection(name)` - Returns a `Collection` object. Also creates `db[name]` so you can do this:\n    \n    db.collection('users')\n    db.users.count(cb)\n\n#### Replica Sets\n\nReplica sets are also supported with an alternate function signature:\n``` JavaScript\nvar hostsArray = [\n  // opts is a hash of mongodb-native server opts: http://mongodb.github.com/node-mongodb-native/api-generated/server.html\n  // also optional\n  {host: \"host1\", port: 27017, opts: {}},\n  {host: \"host1\", port: 27018, opts: {}},\n  ...\n]\n// other replica set opts, such as read_secondary, are passed in here\n// these opts are also passed to each mongodb-native server object, so you can have defaults for your servers\nvar opts = {rs_name: \"myReplicaSet\"}\n\nmongo.db(hostsArray, opts, dbname, [prefix], [username], [password])\n```\n \n\n#### Authentication\n\n`db.auth(username, password, cb)` - You can pass `username` and `password` into mongo.db instead of calling this manually\n\n`db.addUser(username, password, cb)`\n\n`db.removeUser(username, password, cb)`\n\n#### Database \n\n`db.dropDatabase(cb)`\n\n`db.lastError(cb)` - `cb(err, lastError)`\n\n`db.eval(code, [parameters], cb)`\n\n`db.createCollection(name, options, cb)` - allows you to create a collection by hand if you want to specify the options\n\n### Collection\n\n`collection.ensureIndex(index, options, cb)`\n\n`collection.dropIndexes(cb)`\n\n`collection.renameCollection(newName, dropTarget, cb)`\n\n`collection.insert(doc(s), cb)`\n\n`collection.remove(selector, cb)`\n\n`collection.drop(cb)`\n\n`collection.save(doc, cb)`\n\n`collection.update(selector, updates, [upsert], [multi], cb)`\n\n`collection.count(cb)`\n\n`collection.findAndModify(options, cb)`\n\n`collection.find(selector, fields)` - Returns a `Cursor`\n\n`collection.findOne(selector, fields, cb)`\n\n`collection.group(options, cb)`\n\n`collection.mapReduce(map, reduce, options, cb)` - map and reduce can be functions, it will toString them for you. \n\n`collection.distinct(key, [query], cb)`\n\n### Cursor\n\n`cursor.limit(num)` \n\n`cursor.skip(num)`\n\n`cursor.sort({field:1})`\n\n`cursor.next(cb)`\n\n`cursor.explain(cb)`\n\n`cursor.toArray(cb)`\n\n`cursor.count(cb)`\n\n### Useful Exports\n\n`mongo.ObjectID` - you need to wrap any string ids in this class to match on `_id`\n\n","maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"}]},"1.0.0":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"1.0.0","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","scripts":{"test":"mocha --compilers coffee:coffee-script -C test.js","prepublish":"coffee -c lib/*.coffee"},"keywords":["mongodb"],"engines":{"node":">= 0.6.0"},"dependencies":{"mongodb":"1.2.x","async":"~0.1.22"},"dev-dependencies":{"mocha":"~1.8.1"},"directories":{"lib":"lib"},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n[docs]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\n\n## History\n\nv1.0.0 - A complete rewrite of the driver that now uses mongoclient. The interface is generally the same, but all the messiness\nof reconnecting has been removed, as thats transparently handeled by the mongo client. If you see any breakage, please open an issue!\n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual][docs]\n2. Lazy open/close of connections (now handeled by the low level node-mongodb-native)\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Installation\n\n```\n  npm install mongodb-wrapper\n```\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n``` JavaScript\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n```\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n## Documentation\n\nRemember the guiding principle: the syntax exactly matches the [command-line driver][docs], except you pass a call back to any function that hits the database. \n\n#### Connecting\n\nThere are lots of ways to open up a database connection\n`mongo.db(mongodbConnectionString)` - returns a database object, for details on the connection string see [mongodb docs](http://mongodb.github.com/node-mongodb-native/driver-articles/mongoclient.html)\n* NOTE: this mode does not support a prefix!\n`mongo.db(host, port, dbname, [prefix], [username], [password])` - returns a database project\n\n* If prefix is specified all collections will use the prefix in mongo, but you refer to them without the prefix in node.\n* If username and password are specified, it will attempt to authenticate. \n\n`db.collection(name)` - Returns a `Collection` object. Also creates `db[name]` so you can do this:\n    \n    db.collection('users')\n    db.users.count(cb)\n\n#### Replica Sets\n\nReplica sets are also supported with an alternate function signature:\n``` JavaScript\nvar hostsArray = [\n  // opts is a hash of mongodb-native server opts: http://mongodb.github.com/node-mongodb-native/api-generated/server.html\n  // also optional\n  {host: \"host1\", port: 27017, opts: {}},\n  {host: \"host1\", port: 27018, opts: {}},\n  ...\n]\n// other replica set opts, such as read_secondary, are passed in here\n// these opts are also passed to each mongodb-native server object, so you can have defaults for your servers\nvar opts = {rs_name: \"myReplicaSet\"}\n\nmongo.db(hostsArray, opts, dbname, [prefix], [username], [password])\n```\n \n\n#### Authentication\n\n`db.auth(username, password, cb)` - You can pass `username` and `password` into mongo.db instead of calling this manually\n\n`db.addUser(username, password, cb)`\n\n`db.removeUser(username, password, cb)`\n\n#### Database \n\n`db.dropDatabase(cb)`\n\n`db.lastError(cb)` - `cb(err, lastError)`\n\n`db.eval(code, [parameters], cb)`\n\n`db.createCollection(name, options, cb)` - allows you to create a collection by hand if you want to specify the options\n\n### Collection\n\n`collection.ensureIndex(index, options, cb)`\n\n`collection.dropIndexes(cb)`\n\n`collection.renameCollection(newName, dropTarget, cb)`\n\n`collection.insert(doc(s), cb)`\n\n`collection.remove(selector, cb)`\n\n`collection.drop(cb)`\n\n`collection.save(doc, cb)`\n\n`collection.update(selector, updates, [upsert], [multi], cb)`\n\n`collection.count(cb)`\n\n`collection.findAndModify(options, cb)`\n\n`collection.find(selector, fields)` - Returns a `Cursor`\n\n`collection.findOne(selector, fields, cb)`\n\n`collection.group(options, cb)`\n\n`collection.mapReduce(map, reduce, options, cb)` - map and reduce can be functions, it will toString them for you. \n\n`collection.distinct(key, [query], cb)`\n\n### Cursor\n\n`cursor.limit(num)` \n\n`cursor.skip(num)`\n\n`cursor.sort({field:1})`\n\n`cursor.next(cb)`\n\n`cursor.explain(cb)`\n\n`cursor.toArray(cb)`\n\n`cursor.count(cb)`\n\n`cursor.getRawCursor` - retrieves a raw mongodb-native cursor, so you can do things like cursor streams, and other fancy things not supported\n\n### Useful Exports\n\n`mongo.ObjectID` - you need to wrap any string ids in this class to match on `_id`\n\n","readmeFilename":"Readme.md","_id":"mongodb-wrapper@1.0.0","dist":{"shasum":"8c358a72c30b0fa6b4abfde2f8f6898af7838e07","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-1.0.0.tgz","integrity":"sha512-EDAbOjDmKVDH2MMncfPRbB+VXnZbuny82qFHpcG5UTp4v09Ik0SIIyKbjMTpBVq8Bhc730HVqKkze7b+ScHyXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBWZYObqkGSuFHavS27lFPnFjeRiLdVLI3u1tsUzBWfAiEA138nw7dQdExTttYhoOsquu1a1hppECBn1vTBsaupHnc="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"addisonj","email":"addisonj@gmail.com"},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"},{"name":"addisonj","email":"addisonj@gmail.com"}]},"1.0.1":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"1.0.1","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","scripts":{"test":"mocha --compilers coffee:coffee-script -C test.js","prepublish":"coffee -c lib/*.coffee"},"keywords":["mongodb"],"engines":{"node":">= 0.6.0"},"dependencies":{"mongodb":"1.2.x","async":"~0.1.22"},"dev-dependencies":{"mocha":"~1.8.1"},"directories":{"lib":"lib"},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n[docs]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\n\n## History\n\nv1.0.0 - A complete rewrite of the driver that now uses mongoclient. The interface is generally the same, but all the messiness\nof reconnecting has been removed, as thats transparently handeled by the mongo client. If you see any breakage, please open an issue!\n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual][docs]\n2. Lazy open/close of connections (now handeled by the low level node-mongodb-native)\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Installation\n\n```\n  npm install mongodb-wrapper\n```\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n``` JavaScript\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n```\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n## Documentation\n\nRemember the guiding principle: the syntax exactly matches the [command-line driver][docs], except you pass a call back to any function that hits the database. \n\n#### Connecting\n\nThere are lots of ways to open up a database connection\n`mongo.db(mongodbConnectionString)` - returns a database object, for details on the connection string see [mongodb docs](http://mongodb.github.com/node-mongodb-native/driver-articles/mongoclient.html)\n* NOTE: this mode does not support a prefix!\n`mongo.db(host, port, dbname, [prefix], [username], [password])` - returns a database project\n\n* If prefix is specified all collections will use the prefix in mongo, but you refer to them without the prefix in node.\n* If username and password are specified, it will attempt to authenticate. \n\n`db.collection(name)` - Returns a `Collection` object. Also creates `db[name]` so you can do this:\n    \n    db.collection('users')\n    db.users.count(cb)\n\n#### Replica Sets\n\nReplica sets are also supported with an alternate function signature:\n``` JavaScript\nvar hostsArray = [\n  // opts is a hash of mongodb-native server opts: http://mongodb.github.com/node-mongodb-native/api-generated/server.html\n  // also optional\n  {host: \"host1\", port: 27017, opts: {}},\n  {host: \"host1\", port: 27018, opts: {}},\n  ...\n]\n// other replica set opts, such as read_secondary, are passed in here\n// these opts are also passed to each mongodb-native server object, so you can have defaults for your servers\nvar opts = {rs_name: \"myReplicaSet\"}\n\nmongo.db(hostsArray, opts, dbname, [prefix], [username], [password])\n```\n \n\n#### Authentication\n\n`db.auth(username, password, cb)` - You can pass `username` and `password` into mongo.db instead of calling this manually\n\n`db.addUser(username, password, cb)`\n\n`db.removeUser(username, password, cb)`\n\n#### Database \n\n`db.dropDatabase(cb)`\n\n`db.lastError(cb)` - `cb(err, lastError)`\n\n`db.eval(code, [parameters], cb)`\n\n`db.createCollection(name, options, cb)` - allows you to create a collection by hand if you want to specify the options\n\n### Collection\n\n`collection.ensureIndex(index, options, cb)`\n\n`collection.dropIndexes(cb)`\n\n`collection.renameCollection(newName, dropTarget, cb)`\n\n`collection.insert(doc(s), cb)`\n\n`collection.remove(selector, cb)`\n\n`collection.drop(cb)`\n\n`collection.save(doc, cb)`\n\n`collection.update(selector, updates, [upsert], [multi], cb)`\n\n`collection.count(cb)`\n\n`collection.findAndModify(options, cb)`\n\n`collection.find(selector, fields)` - Returns a `Cursor`\n\n`collection.findOne(selector, fields, cb)`\n\n`collection.group(options, cb)`\n\n`collection.mapReduce(map, reduce, options, cb)` - map and reduce can be functions, it will toString them for you. \n\n`collection.distinct(key, [query], cb)`\n\n### Cursor\n\n`cursor.limit(num)` \n\n`cursor.skip(num)`\n\n`cursor.sort({field:1})`\n\n`cursor.next(cb)`\n\n`cursor.explain(cb)`\n\n`cursor.toArray(cb)`\n\n`cursor.count(cb)`\n\n`cursor.getRawCursor` - retrieves a raw mongodb-native cursor, so you can do things like cursor streams, and other fancy things not supported\n\n### Useful Exports\n\n`mongo.ObjectID` - you need to wrap any string ids in this class to match on `_id`\n\n","readmeFilename":"Readme.md","_id":"mongodb-wrapper@1.0.1","dist":{"shasum":"9cec834c90716ccdd3c05e4b0bae8b05ee9cbec5","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-1.0.1.tgz","integrity":"sha512-b+g4OiOnJ8ZO5v6iZwaqbrjlP6ex4fUpWpgetTVardMkJYGHGFGUCSRt3mB5XeVnwxm2D2LFii40P9DGiI2fKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFEXMmRpBWyxTbGW9X58os2YrmC26IuE7sud3DnsFhVvAiEA8l7zlK2xYplj6KgA17frd8LmVVBsXhEuOC2Djq7ycv8="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"addisonj","email":"addisonj@gmail.com"},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"},{"name":"addisonj","email":"addisonj@gmail.com"}]},"1.0.2":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"1.0.2","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","scripts":{"test":"mocha --compilers coffee:coffee-script -C test.js","prepublish":"coffee -c lib/*.coffee"},"keywords":["mongodb"],"engines":{"node":">= 0.6.0"},"dependencies":{"mongodb":"1.2.x","async":"~0.1.22"},"dev-dependencies":{"mocha":"~1.8.1"},"directories":{"lib":"lib"},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n[docs]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\n\n## History\n\nv1.0.0 - A complete rewrite of the driver that now uses mongoclient. The interface is generally the same, but all the messiness\nof reconnecting has been removed, as thats transparently handeled by the mongo client. If you see any breakage, please open an issue!\n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual][docs]\n2. Lazy open/close of connections (now handeled by the low level node-mongodb-native)\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Installation\n\n```\n  npm install mongodb-wrapper\n```\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n``` JavaScript\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n```\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n## Documentation\n\nRemember the guiding principle: the syntax exactly matches the [command-line driver][docs], except you pass a call back to any function that hits the database. \n\n#### Connecting\n\nThere are lots of ways to open up a database connection\n`mongo.db(mongodbConnectionString)` - returns a database object, for details on the connection string see [mongodb docs](http://mongodb.github.com/node-mongodb-native/driver-articles/mongoclient.html)\n* NOTE: this mode does not support a prefix!\n`mongo.db(host, port, dbname, [prefix], [username], [password])` - returns a database project\n\n* If prefix is specified all collections will use the prefix in mongo, but you refer to them without the prefix in node.\n* If username and password are specified, it will attempt to authenticate. \n\n`db.collection(name)` - Returns a `Collection` object. Also creates `db[name]` so you can do this:\n    \n    db.collection('users')\n    db.users.count(cb)\n\n#### Replica Sets\n\nReplica sets are also supported with an alternate function signature:\n``` JavaScript\nvar hostsArray = [\n  // opts is a hash of mongodb-native server opts: http://mongodb.github.com/node-mongodb-native/api-generated/server.html\n  // also optional\n  {host: \"host1\", port: 27017, opts: {}},\n  {host: \"host1\", port: 27018, opts: {}},\n  ...\n]\n// other replica set opts, such as read_secondary, are passed in here\n// these opts are also passed to each mongodb-native server object, so you can have defaults for your servers\nvar opts = {rs_name: \"myReplicaSet\"}\n\nmongo.db(hostsArray, opts, dbname, [prefix], [username], [password])\n```\n \n\n#### Authentication\n\n`db.auth(username, password, cb)` - You can pass `username` and `password` into mongo.db instead of calling this manually\n\n`db.addUser(username, password, cb)`\n\n`db.removeUser(username, password, cb)`\n\n#### Database \n\n`db.dropDatabase(cb)`\n\n`db.lastError(cb)` - `cb(err, lastError)`\n\n`db.eval(code, [parameters], cb)`\n\n`db.createCollection(name, options, cb)` - allows you to create a collection by hand if you want to specify the options\n\n### Collection\n\n`collection.ensureIndex(index, options, cb)`\n\n`collection.dropIndexes(cb)`\n\n`collection.renameCollection(newName, dropTarget, cb)`\n\n`collection.insert(doc(s), cb)`\n\n`collection.remove(selector, cb)`\n\n`collection.drop(cb)`\n\n`collection.save(doc, cb)`\n\n`collection.update(selector, updates, [upsert], [multi], cb)`\n\n`collection.count(cb)`\n\n`collection.findAndModify(options, cb)`\n\n`collection.find(selector, fields)` - Returns a `Cursor`\n\n`collection.findOne(selector, fields, cb)`\n\n`collection.group(options, cb)`\n\n`collection.mapReduce(map, reduce, options, cb)` - map and reduce can be functions, it will toString them for you. \n\n`collection.distinct(key, [query], cb)`\n\n### Cursor\n\n`cursor.limit(num)` \n\n`cursor.skip(num)`\n\n`cursor.sort({field:1})`\n\n`cursor.next(cb)`\n\n`cursor.explain(cb)`\n\n`cursor.toArray(cb)`\n\n`cursor.count(cb)`\n\n`cursor.getRawCursor` - retrieves a raw mongodb-native cursor, so you can do things like cursor streams, and other fancy things not supported\n\n### Useful Exports\n\n`mongo.ObjectID` - you need to wrap any string ids in this class to match on `_id`\n\n","readmeFilename":"Readme.md","_id":"mongodb-wrapper@1.0.2","dist":{"shasum":"0509b351c5f882be37026473a4ac6ced71b44137","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-1.0.2.tgz","integrity":"sha512-8EneXZP1f75Wxl2A9EOsZxxG48CwZvKw54dw829dFxhZYWkn1Hgnsib+ibFCLZ9BZu5RLkg8i7sNCmPJEdmspA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgHh4gAaRmOGJBpsm6vjcWvwZ9FpAekVG1Bkw1AOmY4wIhAPjFx8axueNDiNeCGZ83YS/3J6coSwbl6Z7VuJUEZHpD"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"addisonj","email":"addisonj@gmail.com"},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"},{"name":"addisonj","email":"addisonj@gmail.com"}]},"1.0.3":{"name":"mongodb-wrapper","description":"Exactly-like-the-console wrapper for node-mongodb-native","version":"1.0.3","author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"},"bugs":{"email":"sean@i.tv","url":"http://github.com/idottv/node-mongodb-wrapper/issues"},"main":"index","scripts":{"test":"mocha --compilers coffee:coffee-script -C test.js","prepublish":"coffee -c lib/*.coffee"},"keywords":["mongodb"],"engines":{"node":">= 0.6.0"},"dependencies":{"mongodb":"1.2.x","async":"~0.1.22"},"devDependencies":{"mocha":"~1.8.1","coffee-script":"1.6.x"},"directories":{"lib":"lib"},"readme":"[node-mongodb-native]: https://github.com/christkv/node-mongodb-native     \n[javascript driver]: http://www.mongodb.org/display/DOCS/Manual\n[docs]: http://www.mongodb.org/display/DOCS/Manual\n\n# node-mongodb-wrapper\n\nA wrapper for [node-mongodb-native][node-mongodb-native] as close as possible to the [native javascript driver][javascript driver]. Why learn two interfaces?\n\n\n## History\n\nv1.0.0 - A complete rewrite of the driver that now uses mongoclient. The interface is generally the same, but all the messiness\nof reconnecting has been removed, as thats transparently handeled by the mongo client. If you see any breakage, please open an issue!\n\n## Features\n\n1. Minimal interface closely matching the command-line driver: [http://www.mongodb.org/display/DOCS/Manual][docs]\n2. Lazy open/close of connections (now handeled by the low level node-mongodb-native)\n3. Most features of [node-mongodb-native][node-mongodb-native]\n\n## Installation\n\n```\n  npm install mongodb-wrapper\n```\n\n## Usage\n\n1. You have to tell the db object which collections you're about to use (Harmony Proxies, I need you!)\n2. You have to provide callbacks on \"actionable\" calls (`toArray`, `count`, but not `find`)\n3. Otherwise, just like the native [javascript driver][javascript driver]\n\n``` JavaScript\n\tvar mongo = require('mongodb-wrapper')\n\tvar db = mongo.db('localhost', 27017, 'test')\n\tdb.collection('posts')\n\t\n\tdb.posts.save({title: \"A new post\", body: \"Here is some text\"}, function(err, post) {\n\t\tdb.posts.findOne({_id: doc._id}, function(err, post) {\n\t\t\tdb.posts.find().limit(1).toArray(function(err, posts) {\n\t\t\t\t// posts[0].title == \"A new post\"\n\t\t\t})\n\t\t})\n\t})      \n```\n\nFor more examples, [please look at the test suite](https://github.com/idottv/node-mongodb-wrapper/blob/master/lib/mongodb-wrapper.js)\n\n## Documentation\n\nRemember the guiding principle: the syntax exactly matches the [command-line driver][docs], except you pass a call back to any function that hits the database. \n\n#### Connecting\n\nThere are lots of ways to open up a database connection\n`mongo.db(mongodbConnectionString)` - returns a database object, for details on the connection string see [mongodb docs](http://mongodb.github.com/node-mongodb-native/driver-articles/mongoclient.html)\n* NOTE: this mode does not support a prefix!\n`mongo.db(host, port, dbname, [prefix], [username], [password])` - returns a database project\n\n* If prefix is specified all collections will use the prefix in mongo, but you refer to them without the prefix in node.\n* If username and password are specified, it will attempt to authenticate. \n\n`db.collection(name)` - Returns a `Collection` object. Also creates `db[name]` so you can do this:\n    \n    db.collection('users')\n    db.users.count(cb)\n\n#### Replica Sets\n\nReplica sets are also supported with an alternate function signature:\n``` JavaScript\nvar hostsArray = [\n  // opts is a hash of mongodb-native server opts: http://mongodb.github.com/node-mongodb-native/api-generated/server.html\n  // also optional\n  {host: \"host1\", port: 27017, opts: {}},\n  {host: \"host1\", port: 27018, opts: {}},\n  ...\n]\n// other replica set opts, such as read_secondary, are passed in here\n// these opts are also passed to each mongodb-native server object, so you can have defaults for your servers\nvar opts = {rs_name: \"myReplicaSet\"}\n\nmongo.db(hostsArray, opts, dbname, [prefix], [username], [password])\n```\n \n\n#### Authentication\n\n`db.auth(username, password, cb)` - You can pass `username` and `password` into mongo.db instead of calling this manually\n\n`db.addUser(username, password, cb)`\n\n`db.removeUser(username, password, cb)`\n\n#### Database \n\n`db.dropDatabase(cb)`\n\n`db.lastError(cb)` - `cb(err, lastError)`\n\n`db.eval(code, [parameters], cb)`\n\n`db.createCollection(name, options, cb)` - allows you to create a collection by hand if you want to specify the options\n\n### Collection\n\n`collection.ensureIndex(index, options, cb)`\n\n`collection.dropIndexes(cb)`\n\n`collection.renameCollection(newName, dropTarget, cb)`\n\n`collection.insert(doc(s), cb)`\n\n`collection.remove(selector, cb)`\n\n`collection.drop(cb)`\n\n`collection.save(doc, cb)`\n\n`collection.update(selector, updates, [upsert], [multi], cb)`\n\n`collection.count(cb)`\n\n`collection.findAndModify(options, cb)`\n\n`collection.find(selector, fields)` - Returns a `Cursor`\n\n`collection.findOne(selector, fields, cb)`\n\n`collection.group(options, cb)`\n\n`collection.mapReduce(map, reduce, options, cb)` - map and reduce can be functions, it will toString them for you. \n\n`collection.distinct(key, [query], cb)`\n\n### Cursor\n\n`cursor.limit(num)` \n\n`cursor.skip(num)`\n\n`cursor.sort({field:1})`\n\n`cursor.next(cb)`\n\n`cursor.explain(cb)`\n\n`cursor.toArray(cb)`\n\n`cursor.count(cb)`\n\n`cursor.getRawCursor` - retrieves a raw mongodb-native cursor, so you can do things like cursor streams, and other fancy things not supported\n\n### Useful Exports\n\n`mongo.ObjectID` - you need to wrap any string ids in this class to match on `_id`\n\n","readmeFilename":"Readme.md","_id":"mongodb-wrapper@1.0.3","dist":{"shasum":"8bae5f47d8d721004df228df17d3583560cde04d","tarball":"https://registry.npmjs.org/mongodb-wrapper/-/mongodb-wrapper-1.0.3.tgz","integrity":"sha512-CTNtSKi4dkvLw4KcMI61noaQ1twZ5a5TVln9+8H28dNRKLF6EKo1SLHIV5j8zq7BSdRiBCweLJtlzkkQsGNEfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARliIKQlwpR1vGZuFSz2Y2BAKuAGQC2+Xz4O6ifZlxTAiACw7jS6EtW10IZh1lzuQRfpvjuxJx8KhLzNImNdxFi0g=="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"addisonj","email":"addisonj@gmail.com"},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"},{"name":"addisonj","email":"addisonj@gmail.com"}]}},"maintainers":[{"name":"seanhess","email":"seanhess@gmail.com"},{"name":"addisonj","email":"addisonj@gmail.com"}],"time":{"modified":"2022-06-20T06:37:29.832Z","created":"2011-05-26T18:01:56.869Z","0.1.0":"2011-05-26T18:01:57.324Z","0.1.1":"2011-05-26T21:21:36.710Z","0.2.0":"2011-05-31T20:55:21.518Z","0.2.1":"2011-06-02T22:44:19.425Z","0.2.2":"2011-06-10T17:16:27.419Z","0.2.3":"2011-06-29T03:20:41.192Z","0.2.4":"2011-11-07T18:57:37.594Z","0.2.5":"2011-11-07T19:33:42.980Z","0.2.6":"2011-11-10T03:37:30.412Z","0.2.7":"2012-01-19T17:03:41.002Z","0.3.0":"2012-04-19T17:44:50.959Z","0.4.0":"2012-08-28T16:57:42.565Z","1.0.0":"2013-01-24T17:14:44.655Z","1.0.1":"2013-01-24T18:52:14.569Z","1.0.2":"2013-01-24T19:37:06.423Z","1.0.3":"2013-04-18T15:06:42.902Z"},"author":{"name":"i.TV","email":"sean@i.tv"},"repository":{"type":"git","url":"git://github.com/idottv/node-mongodb-wrapper.git"}}