{"_id":"mongodb-expressions","_rev":"5-ee9209cd412cdbf221a36e4026a916ab","name":"mongodb-expressions","description":"MongoDB expressions for fire.js","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"mongodb-expressions","description":"MongoDB expressions for fire.js","version":"0.1.0","author":{"name":"Firebase.co","email":"npm@firebase.co","url":"http://www.firebase.co"},"main":"./index.js","repository":{"type":"git","url":"git://github.com/firebaseco/mongodb-expressions.git"},"bugs":{"email":"firejs@firebase.co","url":"https://github.com/firebaseco/mongodb-expressions/issues"},"keywords":["ignitable","fire","fire.js","expressions","Mongo","MongoDB","mongoose"],"contributors":[{"name":"Johan Hernandez","email":"johan@firebase.co"}],"dependencies":{"fire":">= 0.1.0","mongodb":">= 0.9.6-19"},"devDependencies":{"vows":">= 0.5.11"},"engines":{"node":">= 0.1.98"},"_npmUser":{"name":"firebaseco","email":"npm@firebase.co"},"_id":"mongodb-expressions@0.1.0","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.3","_defaultsLoaded":true,"dist":{"shasum":"e863035d33b7df237f3eb2dd93852b72e64258fd","tarball":"https://registry.npmjs.org/mongodb-expressions/-/mongodb-expressions-0.1.0.tgz","integrity":"sha512-raaGkAJGmGF/iX107I1ItbMJm7B8JVuraaaL7DZgfaRg2jaS53QdmtO/Y6erh7cyAxY1xy8N7Lp7pQxPKEZPvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICu9vwQ/xrZU8mrPszasfs46m2xf6CJ+XgFvxt+zGr2oAiEAt9SpM86jPAB6d6pwuy1BU8TG8ZjpiE6iPIUoKTud9YY="}]},"maintainers":[{"name":"firebaseco","email":"npm@firebase.co"}]}},"readme":"#mongodb-expressions\n[![Build Status](https://secure.travis-ci.org/firebaseco/mongodb-expressions.png)](http://travis-ci.org/firebaseco/mongodb-expressions)\n\nThe official [MongoDB](http://www.mongodb.org) expressions for [fire.js](https://github.com/firejs/fire)\n***\n\n## @Mongo.Insert\n\nInserts a document in a MongoDB collection given in the hint. Returns the same document with the generated _id.\n\n### Example\n\nThis example inserts a contact document into the contacts collection:\n    \n\t{\n\t\t\"@Mongo.Insert(contacts)\": {\n\t\t\temail: \"johan@firebase.co\"\n\t\t\tfirstName: \"Johan\",\n\t\t\tlastName: \"Hernandez\"\n\t\t}\n\t}\n\t\n### Possible errors and solutions\n\n#### Mongo.Insert requires a hint with the name of the collection\nWhen you call Mongo.Insert you need to provide the name of the collection you want to insert to.\n\n#### Mongo.Insert can only insert one document at the time\nThe input is an array, you can't insert arrays. It must be an object.\n\n#### Mongo.Insert can not insert null documents\nThe input is null. You can't insert null into a collection.\n\n#### Mongo.Insert can only insert object documents\nThe input is anything but an object. Numbers, Functions, Strings can not be inserted directly into a collection.\n\n## @Mongo.Find\n\nRetrieve documents from a collection given in the hint. Returns an array of matched documents by the criteria. If the input is null or @undefined or you don't provide a condition it will retrieve all the documents in the collection.\n\nMongo.Find accepts an input with the following attributes:\n\n    \n\t{\n\t\t\"conditions\": <object, optional>,\n\t\t\"fields\": <array, optional>,\n\t\t\"sort\": <object, optional>,\n\t\t\"limit\": <Number, optional>,\n\t\t\"skip\": <Number, optional>\n\t}\n    \n\n### Input Attributes\n\n#### conditions\n\nAn object with all the conditions to be used as criteria. [More info about MongoDB Queries](http://www.mongodb.org/display/DOCS/Advanced+Queries).\n\n#### fields\n\nAn array with all the fields names to include in the results. It supports [dot notation](http://www.mongodb.org/display/DOCS/Dot+Notation+%28Reaching+into+Objects%29) so you can specify the embedded documents fields too.\n\n#### sort\n\nAn object with all the sorting options. More info [here](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort%28%29%7D%7D) and [here](http://www.mongodb.org/display/DOCS/Querying#Querying-Sorting)\n\n#### limit\n\nIt specifies a maximum number of results to return. [More info](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D).\n\n#### skip\n\nIt specifies at which object the database should begin returning results\n[More info](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D)\n\n### Possible errors and solutions\n\n#### Mongo.Find requires a hint with the name of the collection\nWhen you call Mongo.Find you need to provide the name of the collection you want to query from.\n\n#### Mongo.Find can not currently work with including and excluding fields\nWhen you call Mongo.Find you can't use includingFields and excludingFields options at the same time, you can either use one of them or none of them. \n\n#### Mongo.Find input must be an object\n#### Mongo.Find fields must be an array, @undefined or null\n#### Mongo.Find conditions must be an object, @undefined or null\n#### Mongo.Find sort must be an object, @undefined or null\n#### Mongo.Find options must be an object, @undefined or null\n\n## @Mongo.FindOne\n\nRetrieve a single document from a collection given in the hint matched by criteria. If no document can be matched with by the criteria it will return null. If the input is null or @undefined or you don't provide a condition it will retrieve the first document in the collection.\n\nMongo.FindOne accepts an input with the following attributes:\n\n    \n\t{\n\t\t\"conditions\": <object, optional>,\n\t\t\"fields\": <array, optional>,\n\t\t\"sort\": <object, optional>,\n\t\t\"skip\": <Number, optional>\n\t}\n    \n\n### Input Attributes\n\n#### conditions\n\nAn object with all the conditions to be used as criteria. [More info about MongoDB Queries](http://www.mongodb.org/display/DOCS/Advanced+Queries).\n\n#### fields\n\nAn array with all the fields names to include in the results. It supports [dot notation](http://www.mongodb.org/display/DOCS/Dot+Notation+%28Reaching+into+Objects%29) so you can specify the embedded documents fields too.\n\n#### sort\n\nAn object with all the sorting options. More info [here](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort%28%29%7D%7D) and [here](http://www.mongodb.org/display/DOCS/Querying#Querying-Sorting)\n\n#### skip\n\nIt specifies at which object the database should begin returning results\n[More info](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D)\n\n### Possible errors and solutions\n\nSame errors and solutions than @Mongo.Find\n\n\n## @Mongo.Update\n\nUpdates documents from a collection given in the hint. Returns the count of affected rows. All updates are strict and will return either an error if they fail or the count of update rows if succeeded.\n\nMongo.Update accepts an input with the following attributes:\n    \n\t{\n\t\t\"conditions\": <object>,\n\t\t\"changes\": <object>,\n\t\t\"options\": <object, optional>,\n\t}\n    \n### Input Attributes\n\n#### conditions\n\nAn object with all the conditions to be used as criteria. [More info about MongoDB Queries](http://www.mongodb.org/display/DOCS/Advanced+Queries).\n\n#### changes\n\nAn object with all the changes to perform. [More info about MongoDB udpates](http://www.mongodb.org/display/DOCS/Updating)\n\n#### options\n\nIt specifies the options to use when updating. The more common options are multi and upsert.\n\n##### multi\n\nWhen set to true all matching documents are updated, not just the first.\n\n##### upsert\n\nWhen set to true Atomically inserts the document if no documents matched.\n\n\n### Possible errors and solutions\n\n#### Mongo.Update requires a hint with the name of the collection\nWhen you call Mongo.Update you need to provide the name of the collection you want to update.\n\n#### Mongo.Update input must be an object\n#### Mongo.Update changes must be an object\n#### Mongo.Update options must be an object, @undefined or null\n\n\n## @Mongo.Remove\n\nRemove documents from a collection given in the hint. Returns the count of affected rows. All updates are strict and will return either an error if they fail or the count of removed rows if succeeded.\n\nMongo.Remove accepts an input with a single attribute:\n    \n\t{\n\t\t\"conditions\": <object>\n\t}\n    \n### Input Attributes\n\n#### conditions\n\nAn object with all the conditions to be used as criteria when removing the documents. [More info about MongoDB Queries](http://www.mongodb.org/display/DOCS/Advanced+Queries).\n\n\n### Possible errors and solutions\n\n#### Mongo.Remove requires a hint with the name of the collection\nWhen you call Mongo.Remove you need to provide the name of the collection you want to remove documents from.\n\n#### Mongo.Remove input must be an object\n#### Mongo.Remove conditions must be an object\n\n## @Mongo.DropDatabase\n\nDrops the current database.\n\n### Testing Goodies\n\n`mongodb-expressions` will automatically execute `@Mongo.DropDatabase` when the runtime is loaded in `NODE_ENV` `test`.\n\n### Cloning the Repository\n\n    git clone https://github.com/firebaseco/mongodb-expressions.git\n\n### Tests\n\n    make\n\n### Contributors\n\n* Johan (author). Email: *johan@firebase.co*\n\n## License\n\nCopyright (c) 2011 Firebase.co - [http://www.firebase.co](http://www.firebase.co)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","maintainers":[{"name":"firebaseco","email":"npm@firebase.co"}],"time":{"modified":"2022-06-20T06:23:54.493Z","created":"2011-11-29T22:19:56.267Z","0.1.0":"2011-11-29T22:20:00.757Z"},"author":{"name":"Firebase.co","email":"npm@firebase.co","url":"http://www.firebase.co"},"repository":{"type":"git","url":"git://github.com/firebaseco/mongodb-expressions.git"}}