{"_id":"dino","_rev":"31-ad00396747f745ab4b702a7ca69e9aef","name":"dino","description":"A simple DynamoDB object modeler for Node.js.","dist-tags":{"latest":"0.3.5"},"versions":{"0.0.1":{"name":"dino","version":"0.0.1","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"~1.4.0","moment":"~1.7.2","underscore":"~1.4.3","aws-sdk":"~0.9.6-pre.7"},"devDependencies":{"mocha":"~1.7.4","should":"~1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"readme":"# Dino\n\nA simple DynamoDB object modeler for node.js.\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## Usage\n\nCross-ref with [Amazon's sample data](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html):\n\n### Connect\n\nCreates a DynamoDB client using your credentials. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables) instead.\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n### Schema\n\nSets the table, property types and primary keys.\n\n```js\nvar table = 'forums',\n    attributes = {\n        name: String,\n        category: String,\n        thread_count: Number,\n        view_count: Number,\n        last_post_author: String,\n        last_post_date: Date\n    },\n    key = {\n        hash: 'name'\n    },\n    schema = new dino.Schema(table, attributes, key);\n```\n\n### Model\n\nExtend `dino.Model` to create a model definition. All models require an instance of `dino.Schema`.\n\n```js\nvar Forum = dino.Model.extend({\n    schema: new dino.Schema(table, attributes, key)\n});\n\nvar forum = new Forum({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services',\n    thread_count: 3,\n    view_count: 4,\n    last_post_author: 'User A',\n    last_post_date: moment.utc()\n})\n```\n\n#### save\n\nSaves the model.\n\n```js\nforum.save(function(err, units){\n    \n});\n```\n\n#### destroy\n\nDeletes the model.\n\n```js\nforum.destroy(function(err, units){\n    // (poof)\n});\n```\n\n#### find\n\nReturns an array of model instances.\n\n```js\n// Find the first page of replies for a thread\nReply.find({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    skip: 0,\n    take: 10\n}, function(err, forums, units){\n    \n});\n```\n\nQuery parameters:\n\n- hash (required)\n- range\n- skip\n- take\n\n#### findOne\n\nReturns a single model by hash and/or range key.\n\n```js\nForum.findOne({\n    hash: 'Amazon DynamoDB'\n}, function(err, forum, units){\n    \n});\n\nReply.findOne({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    range: '2011-12-11T00:40:57.165Z'\n}, function(err, reply, units){\n    \n});\n```\n\n#### toJSON\n\nReturns a JSON-like representation of an model's properties.\n\n```js\nforum.toJSON();\n\n//  {\n//    name: 'Amazon DynamoDB',\n//    category: 'Amazon Web Services',\n//    thread_count: 3,\n//    view_count: 4,\n//    last_post_author: 'User A',\n//    last_post_date: [Object]\n//  }\n```\n\n### Key Smushing\n\nDynamoDB's [Query API](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API_Query.html) allows you to query by hash and range primary keys. To create more complex queries, you can combine multiple attributes into a single key. Dino accepts arrays as key definitions and will combine and parse these attributes automatically.\n\n```js\nvar table = 'threads',\n    attributes = {\n        forum_name: String,\n        subject: Number\n    },\n    key = {\n        hash: ['forum_name', 'subject'] // smush together\n    },\n    Thread = dino.Model.extend({\n        schema: new dino.Schema(table, attributes, key)\n    });\n\nnew Thread({\n    forum_name: 'Amazon DynamoDB',\n    subject: 'DynamoDB Thread 1'\n}).save();\n\n// \"forum_name#subject\": \"Amazon DynamoDB#DynamoDB Thread 1\"\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## License\n\nCopyright (C) 2013 Christopher Cliff\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"dino@0.0.1","dist":{"shasum":"c2868f5a988f24204e672808871ba7940495e632","tarball":"https://registry.npmjs.org/dino/-/dino-0.0.1.tgz","integrity":"sha512-Zv7CP/sW8h2OKVlVEyJY3RYj8EkFHOobzvpA0buknUC7ARpUfs4g6XObFsH8fJnk3HVvXIm1sa5Guwv1uUKTaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ0ZLYtfLVDZ3CnT5qfHW745q7Vo7ZeOwdPvh/r9tCSwIgSVWkYgcvVVlZQ9y6YhEXD79JcTpzA0q7Hn0Cz7lDxeQ="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.1.0":{"name":"dino","version":"0.1.0","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"~1.4.0","moment":"~1.7.2","underscore":"~1.4.3","aws-sdk":"~0.9.6-pre.7"},"devDependencies":{"mocha":"~1.7.4","should":"~1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"readme":"# Dino\n\nA simple DynamoDB object modeler for Node.js.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## Usage\n\nCross-ref with [Amazon's sample data](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html):\n\n### connect\n\nCreates a DynamoDB client using your credentials. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables) instead.\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n### Schema\n\nSets the table, property types and primary keys.\n\n```js\nvar table = 'forums',\n    attributes = {\n        name: dino.types.String,\n        category: dino.types.String,\n        thread_count: dino.types.Number,\n        view_count: dino.types.Number,\n        last_post_author: dino.types.String,\n        last_post_date: dino.types.Date\n    },\n    key = {\n        hash: 'name'\n    },\n    schema = new dino.Schema(table, attributes, key);\n```\n\n#### Types\n\nDino ships with several schema types:\n\n- `dino.types.Boolean`\n- `dino.types.Date`\n- `dino.types.Id`\n- `dino.types.Number`\n- `dino.types.Object`\n- `dino.types.String`\n\nTo create a custom type, extend `dino.Type`:\n\n```js\nvar MyType = dino.Type.extend({\n    defaultValue: function () {},\n    parseValue: function (val) {},\n    transformValue: function (val) {}\n});\n```\n\n### Model\n\nExtend `dino.Model` to create a model definition. All models require an instance of `dino.Schema`.\n\n```js\nvar Forum = dino.Model.extend({\n    schema: new dino.Schema(table, attributes, key)\n});\n\nvar forum = new Forum({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services',\n    thread_count: 3,\n    view_count: 4,\n    last_post_author: 'User A',\n    last_post_date: moment.utc()\n})\n```\n\n#### save\n\nSaves the model.\n\n```js\nforum.save(function(err, units){\n    \n});\n```\n\n#### destroy\n\nDeletes the model.\n\n```js\nforum.destroy(function(err, units){\n    // (poof)\n});\n```\n\n#### find\n\nReturns an array of model instances.\n\n```js\n// Find the first page of replies for a thread\nReply.find({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    skip: 0,\n    take: 10\n}, function(err, forums, units){\n    \n});\n```\n\nQuery parameters:\n\n- hash (required)\n- range\n- skip\n- take\n\n#### findOne\n\nReturns a single model by hash and/or range key.\n\n```js\nForum.findOne({\n    hash: 'Amazon DynamoDB'\n}, function(err, forum, units){\n    \n});\n\nReply.findOne({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    range: '2011-12-11T00:40:57.165Z'\n}, function(err, reply, units){\n    \n});\n```\n\n#### toJSON\n\nReturns a JSON-like representation of the model's properties.\n\n```js\nforum.toJSON();\n\n//  {\n//    name: 'Amazon DynamoDB',\n//    category: 'Amazon Web Services',\n//    thread_count: 3,\n//    view_count: 4,\n//    last_post_author: 'User A',\n//    last_post_date: [Object]\n//  }\n```\n\n### Key Smushing\n\nDynamoDB's [Query API](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API_Query.html) allows you to query by hash and range primary keys. To create more complex queries, you can combine multiple attributes into a single key. Dino accepts arrays as key definitions and will combine and parse these attributes automatically.\n\n```js\nvar table = 'threads',\n    attributes = {\n        forum_name: String,\n        subject: Number\n    },\n    key = {\n        hash: ['forum_name', 'subject'] // smush together\n    },\n    Thread = dino.Model.extend({\n        schema: new dino.Schema(table, attributes, key)\n    });\n\nnew Thread({\n    forum_name: 'Amazon DynamoDB',\n    subject: 'DynamoDB Thread 1'\n}).save();\n\n// \"forum_name#subject\": \"Amazon DynamoDB#DynamoDB Thread 1\"\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## License\n\nCopyright (C) 2013 Christopher Cliff\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"dino@0.1.0","dist":{"shasum":"d8f833e10da43625512e18cbb66b9fca0d611e05","tarball":"https://registry.npmjs.org/dino/-/dino-0.1.0.tgz","integrity":"sha512-yyVU0GKcIyCeK6BOMnf0c/OKXSfe8acChAe/Dw5YmOzhk9FgBDrmgvhYJDBYpJ2dGZZ5S2nh1wuf67nMVEUhdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5+ZratuZRkhLeSzzlxrwpcx6ECwRWcjAknsnUw6zK1AIgB42AJ5tlbJWcnbKE4dgurShmobRcuHDJ46STkBuC3lY="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.1.1":{"name":"dino","version":"0.1.1","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"~1.4.0","moment":"~1.7.2","underscore":"~1.4.3","aws-sdk":"~0.9.6-pre.7"},"devDependencies":{"mocha":"~1.7.4","should":"~1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"readme":"# Dino\n\nA simple DynamoDB object modeler for Node.js.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## Usage\n\nCross-ref with [Amazon's sample data](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html):\n\n### connect\n\nCreates a DynamoDB client using your credentials. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables) instead.\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n### Schema\n\nSets the table, property types and primary keys.\n\n```js\nvar table = 'forums',\n    attributes = {\n        name: dino.types.String,\n        category: dino.types.String,\n        thread_count: dino.types.Number,\n        view_count: dino.types.Number,\n        last_post_author: dino.types.String,\n        last_post_date: dino.types.Date\n    },\n    key = {\n        hash: 'name'\n    },\n    schema = new dino.Schema(table, attributes, key);\n```\n\n#### Types\n\nDino ships with several schema types:\n\n- `dino.types.Boolean`\n- `dino.types.Date`\n- `dino.types.Id`\n- `dino.types.Number`\n- `dino.types.Object`\n- `dino.types.String`\n\nTo create a custom type, extend `dino.Type`:\n\n```js\nvar MyType = dino.Type.extend({\n    defaultValue: function () {},\n    parseValue: function (val) {},\n    transformValue: function (val) {}\n});\n```\n\n### Model\n\nExtend `dino.Model` to create a model definition. All models require an instance of `dino.Schema`.\n\n```js\nvar Forum = dino.Model.extend({\n    schema: new dino.Schema(table, attributes, key)\n});\n\nvar forum = new Forum({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services',\n    thread_count: 3,\n    view_count: 4,\n    last_post_author: 'User A',\n    last_post_date: moment.utc()\n})\n```\n\n#### save\n\nSaves the model.\n\n```js\nforum.save(function(err, units){\n    \n});\n```\n\n#### destroy\n\nDeletes the model.\n\n```js\nforum.destroy(function(err, units){\n    // (poof)\n});\n```\n\n#### find\n\nReturns an array of model instances.\n\n```js\n// Find the first page of replies for a thread\nReply.find({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    skip: 0,\n    take: 10\n}, function(err, forums, units){\n    \n});\n```\n\nQuery parameters:\n\n- hash (required)\n- range\n- skip\n- take\n\n#### findOne\n\nReturns a single model by hash and/or range key.\n\n```js\nForum.findOne({\n    hash: 'Amazon DynamoDB'\n}, function(err, forum, units){\n    \n});\n\nReply.findOne({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    range: '2011-12-11T00:40:57.165Z'\n}, function(err, reply, units){\n    \n});\n```\n\n#### toJSON\n\nReturns a JSON-like representation of the model's properties.\n\n```js\nforum.toJSON();\n\n//  {\n//    name: 'Amazon DynamoDB',\n//    category: 'Amazon Web Services',\n//    thread_count: 3,\n//    view_count: 4,\n//    last_post_author: 'User A',\n//    last_post_date: [Object]\n//  }\n```\n\n### Key Smushing\n\nDynamoDB's [Query API](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API_Query.html) allows you to query by hash and range primary keys. To create more complex queries, you can combine multiple attributes into a single key. Dino accepts arrays as key definitions and will combine and parse these attributes automatically.\n\n```js\nvar table = 'threads',\n    attributes = {\n        forum_name: String,\n        subject: Number\n    },\n    key = {\n        hash: ['forum_name', 'subject'] // smush together\n    },\n    Thread = dino.Model.extend({\n        schema: new dino.Schema(table, attributes, key)\n    });\n\nnew Thread({\n    forum_name: 'Amazon DynamoDB',\n    subject: 'DynamoDB Thread 1'\n}).save();\n\n// \"forum_name#subject\": \"Amazon DynamoDB#DynamoDB Thread 1\"\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## License\n\nCopyright (C) 2013 Christopher Cliff\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"dino@0.1.1","dist":{"shasum":"e3e2678818445a56cbf6b95765dd2b1623769cda","tarball":"https://registry.npmjs.org/dino/-/dino-0.1.1.tgz","integrity":"sha512-SlgWqrVDU5/smxe7Q7zN0KeqDzoib2u8zUUhkXHmJv9hqRapgsSQyXvVgaPZlHYz5+qZAyyJAQsKYBuGTktlog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFuAjNJzaqTuqfF7LnTPqrYIumCKQVYBcu+uYHxrCan0AiEA546VXftFF+4fvORITqXE1P9KOL8RfT/NvzheEoQINSI="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.1.2":{"name":"dino","version":"0.1.2","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"~1.4.0","moment":"~1.7.2","underscore":"~1.4.3","aws-sdk":"~0.9.6-pre.7"},"devDependencies":{"mocha":"~1.7.4","should":"~1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"readme":"# Dino\n\nA simple DynamoDB object modeler for Node.js.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## Usage\n\nCross-ref with [Amazon's sample data](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html):\n\n### connect\n\nCreates a DynamoDB client using your credentials. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables) instead.\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n### Schema\n\nSets the table, property types and primary keys.\n\n```js\nvar table = 'forums',\n    attributes = {\n        name: dino.types.String,\n        category: dino.types.String,\n        thread_count: dino.types.Number,\n        view_count: dino.types.Number,\n        last_post_author: dino.types.String,\n        last_post_date: dino.types.Date\n    },\n    key = {\n        hash: 'name'\n    },\n    schema = new dino.Schema(table, attributes, key);\n```\n\n#### Types\n\nDino ships with several schema types:\n\n- `dino.types.Boolean`\n- `dino.types.Date`\n- `dino.types.Id`\n- `dino.types.Number`\n- `dino.types.Object`\n- `dino.types.String`\n\nTo create a custom type, extend `dino.Type`:\n\n```js\nvar MyType = dino.Type.extend({\n    defaultValue: function () {},\n    parseValue: function (val) {},\n    transformValue: function (val) {}\n});\n```\n\n### Model\n\nExtend `dino.Model` to create a model definition. All models require an instance of `dino.Schema`.\n\n```js\nvar Forum = dino.Model.extend({\n    schema: new dino.Schema(table, attributes, key)\n});\n\nvar forum = new Forum({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services',\n    thread_count: 3,\n    view_count: 4,\n    last_post_author: 'User A',\n    last_post_date: moment.utc()\n})\n```\n\n#### save\n\nSaves the model.\n\n```js\nforum.save(function(err, units){\n    \n});\n```\n\n#### destroy\n\nDeletes the model.\n\n```js\nforum.destroy(function(err, units){\n    // (poof)\n});\n```\n\n#### find\n\nReturns an array of model instances.\n\n```js\n// Find the first page of replies for a thread\nReply.find({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    skip: 0,\n    take: 10\n}, function(err, forums, units){\n    \n});\n```\n\nQuery parameters:\n\n- hash (required)\n- range\n- skip\n- take\n\n#### findOne\n\nReturns a single model by hash and/or range key.\n\n```js\nForum.findOne({\n    hash: 'Amazon DynamoDB'\n}, function(err, forum, units){\n    \n});\n\nReply.findOne({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    range: '2011-12-11T00:40:57.165Z'\n}, function(err, reply, units){\n    \n});\n```\n\n#### toJSON\n\nReturns a JSON-like representation of the model's properties.\n\n```js\nforum.toJSON();\n\n//  {\n//    name: 'Amazon DynamoDB',\n//    category: 'Amazon Web Services',\n//    thread_count: 3,\n//    view_count: 4,\n//    last_post_author: 'User A',\n//    last_post_date: [Object]\n//  }\n```\n\n### Key Smushing\n\nDynamoDB's [Query API](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API_Query.html) allows you to query by hash and range primary keys. To create more complex queries, you can combine multiple attributes into a single key. Dino accepts arrays as key definitions and will combine and parse these attributes automatically.\n\n```js\nvar table = 'threads',\n    attributes = {\n        forum_name: String,\n        subject: Number\n    },\n    key = {\n        hash: ['forum_name', 'subject'] // smush together\n    },\n    Thread = dino.Model.extend({\n        schema: new dino.Schema(table, attributes, key)\n    });\n\nnew Thread({\n    forum_name: 'Amazon DynamoDB',\n    subject: 'DynamoDB Thread 1'\n}).save();\n\n// \"forum_name#subject\": \"Amazon DynamoDB#DynamoDB Thread 1\"\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## License\n\nCopyright (C) 2013 Christopher Cliff\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"dino@0.1.2","dist":{"shasum":"21c027a8cf5340a15955480937307f5c84588238","tarball":"https://registry.npmjs.org/dino/-/dino-0.1.2.tgz","integrity":"sha512-EZqSvq5lyBgfVttJJAYEg1ZuOfmzKMJlOGvgC4u5oTyIdwzjOMzzPVP3zdXztD8Wx12JinGp1DZNLQiJjMcDlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBaKDds1+D+laGQlaHgXpkunqSo1odbc4YSLLbA8bPkQIgboHjUxiyD8R+M5cCk99L7sUmZDEiD+75a77oaZjDmYQ="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.2.0":{"name":"dino","version":"0.2.0","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"~1.4.0","moment":"~1.7.2","underscore":"~1.4.3","aws-sdk":"~0.9.6-pre.7"},"devDependencies":{"mocha":"~1.7.4","should":"~1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"_id":"dino@0.2.0","readme":"ERROR: No README.md file found!","dist":{"shasum":"33baaef52903ce45aa69e01c0284bf9c01d6cf43","tarball":"https://registry.npmjs.org/dino/-/dino-0.2.0.tgz","integrity":"sha512-it2SidKBiCN0il2KSbMVGP6bSKuwzf1DANDuxHu3etU7B6BeP9ieiAAGjm6pASpIXqozp9f/Q8rKbPmCVkiM5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEonNiEHXOgna4Qta1gAjVx+cbzCnWW04RP9pDEQxO5AiEA0ee7Ll0d4gzvZDC05EmtdbvVdX5gxMDcWwY163mckiQ="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.2.1":{"name":"dino","version":"0.2.1","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"~1.4.0","moment":"~1.7.2","underscore":"~1.4.3","aws-sdk":"~0.9.6-pre.7"},"devDependencies":{"mocha":"~1.7.4","should":"~1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"readme":"# Dino\n\nA simple [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) object modeler for Node.js.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Usage\n\n```js\nvar dino = require('dino');\n\ndino.connect({\n    accessKeyId: 'MY_KEY',\n    secretAccessKey: 'MY_SECRET',\n    region: 'us-east-1'\n});\n\nvar Forum = dino.model({\n    schema: dino.schema({\n        table: 'forums',\n        attributes: {\n            name: dino.types.string,\n            category: dino.types.string\n        },\n        key: {\n            hash: 'name'\n        }\n    })\n});\n\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n\nforum.save();\n```\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## API\n\n- [`connect()`](#connectoptions)\n- [`connection.client`](#connectionclient)\n- [`connection.create()`](#connectioncreateoptions)\n- [`schema()`](#schemaoptions)\n- [`schema.createTable()`](#schemacreatetableoptions)\n- [`type()`](#typeoptions)\n- [`model()`](#modeloptions)\n- [`Model.create()`](#modelcreateattributes)\n- [`Model.findOne()`](#modelfindoneoptions-callback)\n- [`Model.find()`](#modelfindoptions-callback)\n- [`Model.destroy()`](#modeldestroyoptions-callback)\n- [`model.set()`](#modelsetattributes)\n- [`model.get()`](#modelgetattribute)\n- [`model.save()`](#modelsavecallback)\n- [`model.destroy()`](#modeldestroycallback)\n- [`model.toJSON()`](#modeltojson)\n- [`collection.toJSON()`](#collectiontojson)\n- [`collection.models`](#collectionmodels)\n\n### `connect(options)`\n\nSets the default [DynamoDB client](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/Client.html) for your application. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables).\n\n```js\ndino.connect({\n    accessKeyId: 'MY_KEY',\n    secretAccessKey: 'MY_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `connection.client`\n\nThe default DynamoDB client.\n\n### `connection.create(options)`\n\nCreates a DynamoDB client to be used at your will.\n\n```js\nvar client = dino.connection.create({\n    accessKeyId: 'MY_OTHER_KEY',\n    secretAccessKey: 'MY_OTHER_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `schema(options)`\n\nCreates a schema.\n\n```js\nvar forumSchema = dino.schema({\n    table: 'forums',\n    attributes: {\n        name: dino.types.string,\n        category: dino.types.string\n    },\n    key: {\n        hash: 'name'\n    }\n});\n```\n\n#### options\n\n- `table` (required)\n- `attributes` (required)\n- `key` (required)\n- `keyDelimiter`\n\n#### types\n\n- `boolean`\n- `date`\n- `id`\n- `number`\n- `object`\n- `string`\n\n### schema.createTable(options);\n\nCreates a table in DynamoDB.\n\n```js\nforumSchema.createTable({\n    readUnits: 1,\n    writeUnits: 1\n}, function(err, units){  });\n```\n\n#### options\n\n- `client`\n- `readUnits`\n- `writeUnits`\n\n### type(options)\n\nCreates a schema type.\n\n```js\nvar myType = dino.type({\n    defaultValue: null,\n    serialize: function (val) { return val; },\n    deserialize: function (val) { return val; },\n    toJSON: function (val) { return val; }\n});\n```\n\n#### options\n\n- `defaultValue`\n- `serialize`\n- `deserialize`\n- `toJSON`\n\n### `model(options)`\n\nCreates a Model object. Use Model objects to create and query models.\n\n```js\nvar Forum = dino.model({\n    schema: forumSchema\n});\n```\n\n#### options\n\n- `schema` (required)\n- `client`\n\n### `Model.create(attributes)`\n\nCreates a model.\n\n```js\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n```\n\n### `Model.findOne(options[, callback])`\n\nQueries DynamoDB for a single model.\n\n```js\nForum.findOne({\n    hash: 'Amazon DynamoDB'\n}, function(err, forum, units){  });\n```\n\n#### options\n\n- `hash` (required)\n- `range`\n\n### `Model.find(options[, callback])`\n\nQueries DynamoDB for a collection of models.\n\n```js\nReply.find({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    take: 10\n}, function(err, replies, units){  });\n```\n\n#### options\n\n- `hash` (required)\n- `range`\n- `skip`\n- `take`\n\n### `Model.destroy(options[, callback])`\n\nDeletes a model from DynamoDB.\n\n```js\nForum.destroy({\n    hash: 'Amazon DynamoDB'\n}, function(err, units){  });\n```\n\n#### options\n\n- `hash` (required)\n- `range`\n\n### `model.set(attributes)`\n\nSets the model's attributes.\n\n```js\nforum.set({\n    name: 'Amazon S3'\n});\n```\n\n### `model.get(attribute)`\n\nGets the model's attributes.\n\n```js\nforum.get('name'); // 'Amazon S3'\n```\n\n### `model.save([callback])`\n\nSaves the model to DynamoDB.\n\n```js\nforum.save(function(err, units){  });\n```\n\n### `model.destroy([callback])`\n\nDeletes the model from DynamoDB.\n\n```js\nforum.destroy(function(err, units){  });\n```\n\n### `model.toJSON()`\n\nReturns the JSON serialized attributes of the model.\n\n```js\nforum.toJSON();\n```\n\n### `collection.toJSON()`\n\nReturns an array where each model in the collection has been JSON serialized.\n\n```js\nreplies.toJSON();\n```\n\n### `collection.models`\n\nThe raw array of models in the collection.\n\n```js\nreplies.models;\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## License\n\nCopyright (C) 2013 Christopher Cliff\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"dino@0.2.1","dist":{"shasum":"4bb6b4c9bbb3ad185cfbfc33a1f6758dfdd40836","tarball":"https://registry.npmjs.org/dino/-/dino-0.2.1.tgz","integrity":"sha512-s5DpWiH29teD2hxHWy/DyQP95YghQ0VghCq21u4Yz5ZrMoi+yDQMilnSUTbS7yaCHmfN4bE7gUMM+Ue1a/IjHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh5JlHFJdOvOXJy6OmJuWOXVp8/7XMKsiZ8euKWEmemAIgJpNOTzaWf/xVgYVTNNWrC0AP030+h+pHKv20N+JbQu0="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.2.2":{"name":"dino","version":"0.2.2","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"0.9.6-pre.7"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"_id":"dino@0.2.2","readme":"ERROR: No README.md file found!","dist":{"shasum":"83d09648160bb52e6802691be241bf9d0102ce56","tarball":"https://registry.npmjs.org/dino/-/dino-0.2.2.tgz","integrity":"sha512-opby3YNBDfxz+1HVz9bkp8F9KhA5peCgEtrJMTEc6aOWOKUax175hbZANv+iuLz0rYOjA2SrrobxdBdnDOJWZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9zKvutTb5jvHto9oRoBQBKkIY9bIgwLKYm6/e/mtragIgTBV1qRPJajyw14pNcQbQC2HIxq+OUtXwROyeUSyHv8U="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.2.3":{"name":"dino","version":"0.2.3","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"0.9.6-pre.7"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"_id":"dino@0.2.3","readme":"ERROR: No README.md file found!","dist":{"shasum":"b86bc9a72c256a2166264f49f6fb8daf150e9437","tarball":"https://registry.npmjs.org/dino/-/dino-0.2.3.tgz","integrity":"sha512-mrHDnOH56twd+WDYMb7+dmh+N6O4Q/YCo+0BFcuGck9sMhN2adaoAsUxnkLZ7Gk1+tBSqLdf1H7D9RNCs4uuyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyOdprxyVX44zZlEckxUgZsbO9/kN5+WgmNN3j4R0q1AIgceHMJztQDU0w12JJuDSau4c1OYxUMvymEvXHKNLTbug="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.3.0":{"name":"dino","version":"0.3.0","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"0.9.9-pre.10"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"readme":"# Dino\n\nA simple [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) object modeler for Node.js.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Usage\n\n```js\nvar dino = require('dino');\n\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n\nvar Forum = dino.model({\n    schema: dino.schema({\n        table: 'forums',\n        attributes: {\n            name: dino.types.string,\n            category: dino.types.string\n        },\n        key: {\n            hash: 'name'\n        }\n    })\n});\n\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n\nforum.save();\n```\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## API\n\n- [`connect()`](#connectoptions)\n- [`connection.client`](#connectionclient)\n- [`connection.create()`](#connectioncreateoptions)\n- [`schema()`](#schemaoptions)\n- [`schema.createTable()`](#schemacreatetableoptions)\n- [`type()`](#typeoptions)\n- [`model()`](#modeloptions)\n- [`Model.create()`](#modelcreateattributes)\n- [`Model.findOne()`](#modelfindoneoptions-callback)\n- [`Model.find()`](#modelfindoptions-callback)\n- [`Model.destroy()`](#modeldestroyoptions-callback)\n- [`model.set()`](#modelsetattributes)\n- [`model.get()`](#modelgetattribute)\n- [`model.save()`](#modelsavecallback)\n- [`model.destroy()`](#modeldestroycallback)\n- [`model.toJSON()`](#modeltojson)\n- [`collection.toJSON()`](#collectiontojson)\n- [`collection.models`](#collectionmodels)\n\n### `connect(options)`\n\nSets the default [DynamoDB client](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/Client.html) for your application. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables).\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `connection.client`\n\nThe default DynamoDB client.\n\n### `connection.create(options)`\n\nCreates a DynamoDB client to be used at your will.\n\n```js\nvar client = dino.connection.create({\n    accessKeyId: 'YOUR_OTHER_KEY',\n    secretAccessKey: 'YOUR_OTHER_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `schema(options)`\n\nCreates a schema.\n\n```js\nvar forumSchema = dino.schema({\n    table: 'forums',\n    attributes: {\n        name: dino.types.string,\n        category: dino.types.string\n    },\n    key: {\n        hash: 'name'\n    }\n});\n```\n\n#### options\n\n- `table` (required)\n- `attributes` (required)\n- `key` (required)\n- `keyDelimiter`\n\n#### types\n\n- `boolean`\n- `date`\n- `id`\n- `number`\n- `object`\n- `string`\n\n### schema.createTable(options);\n\nCreates a table in DynamoDB.\n\n```js\nforumSchema.createTable({\n    readUnits: 5,\n    writeUnits: 2\n}, function(err, units){  });\n```\n\n#### options\n\n- `client`\n- `readUnits`\n- `writeUnits`\n\n### type(options)\n\nCreates a schema type.\n\n```js\nvar myType = dino.type({\n    defaultValue: null,\n    serialize: function (val) { return val; },\n    deserialize: function (val) { return val; },\n    toJSON: function (val) { return val; }\n});\n```\n\n#### options\n\n- `defaultValue`\n- `serialize`\n- `deserialize`\n- `toJSON`\n\n### `model(options)`\n\nCreates a Model object. Use Model objects to create and query models.\n\n```js\nvar Forum = dino.model({\n    schema: forumSchema\n});\n```\n\n#### options\n\n- `schema` (required)\n- `client`\n\n### `Model.create(attributes)`\n\nCreates a model.\n\n```js\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n```\n\n### `Model.findOne(match[, callback])`\n\nQueries DynamoDB for a single model.\n\n```js\nForum.findOne({\n    name: 'Amazon DynamoDB'\n}, function(err, forum, units){  });\n```\n\n### `Model.find(options[, callback])`\n\nQueries DynamoDB for a collection of models.\n\n```js\nReply.find({\n    match: {\n        forum_name: 'Amazon DynamoDB',\n        thread_name: 'DynamoDB Thread 1'\n    }\n    take: 10\n}, function(err, replies, units){  });\n```\n\n#### options\n\n- `match` (required)\n- `skip`\n- `take`\n- `sortBy`\n\n### `Model.destroy(match[, callback])`\n\nDeletes a model from DynamoDB.\n\n```js\nForum.destroy({\n    name: 'Amazon DynamoDB'\n}, function(err, units){  });\n```\n\n### `model.set(attributes)`\n\nSets the model's attributes.\n\n```js\nforum.set({\n    name: 'Amazon S3'\n});\n```\n\n### `model.get(attribute)`\n\nGets the model's attributes.\n\n```js\nforum.get('name'); // 'Amazon S3'\n```\n\n### `model.save([callback])`\n\nSaves the model to DynamoDB.\n\n```js\nforum.save(function(err, units){  });\n```\n\n### `model.destroy([callback])`\n\nDeletes the model from DynamoDB.\n\n```js\nforum.destroy(function(err, units){  });\n```\n\n### `model.toJSON()`\n\nReturns the JSON serialized attributes of the model.\n\n```js\nforum.toJSON();\n```\n\n### `collection.toJSON()`\n\nReturns an array where each model in the collection has been JSON serialized.\n\n```js\nreplies.toJSON();\n```\n\n### `collection.models`\n\nThe raw array of models in the collection.\n\n```js\nreplies.models;\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## Changelog\n\n### 0.3.0 &mdash; [May 5, 2013](https://github.com/christophercliff/dino/compare/0.2.3...0.3.0)\n\n- Migrated to DynamoDB API version 2012-08-10, which allows for secondary indexes. You can now query, sort and destroy by secondary index. Review the documentation on `find()`, `findOne`, and `destroy()` to see the changes to the API.","_id":"dino@0.3.0","dist":{"shasum":"0cee68274d035e3bc58ee61afbfdaa8562a43208","tarball":"https://registry.npmjs.org/dino/-/dino-0.3.0.tgz","integrity":"sha512-ussOHNXDEHfLR8eONDOQ8f+Rfj8YAS91Kvik21GybIj+L+b79KZ59/555busfEHhlPxrqaZweqcK4TIKEHTQUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqeCoZ9Xp7tEE2ybVSIxotsxIdWWnGaTqZQLPhld/WvAIgBjuMFaQH3XBtTVqXsqX/pEjuWN6fls1ghg80HU5VKpo="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.3.1":{"name":"dino","version":"0.3.1","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"0.9.9-pre.10"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"_id":"dino@0.3.1","readme":"ERROR: No README.md file found!","dist":{"shasum":"89a328338970d8c6db77a80bf690f61de715e8c1","tarball":"https://registry.npmjs.org/dino/-/dino-0.3.1.tgz","integrity":"sha512-d7J+tWO35UMf0uyY8CdUuvKmgtADZ4WJk4fRcauoZ0OuVjo3y7t7yLH9SDaSLZnKD3Icit8ndosXUbL1uB5+5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJIegsRuQ1k5Ex5ZRgeLpsYNuZJjeidKh5wXO/4Ily4gIgYWXQ6QnmqTHAdlgJfsXZl57H6teps89ZVPbGvEaUiNI="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.3.2":{"name":"dino","version":"0.3.2","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"1.0.0"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"readme":"# Dino\n\nA simple [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) object modeler for Node.js.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Usage\n\n```js\nvar dino = require('dino');\n\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n\nvar Forum = dino.model({\n    schema: dino.schema({\n        table: 'forums',\n        attributes: {\n            name: dino.types.string,\n            category: dino.types.string\n        },\n        key: {\n            hash: 'name'\n        }\n    })\n});\n\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n\nforum.save();\n```\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## API\n\n- [`connect()`](#connectoptions)\n- [`connection.client`](#connectionclient)\n- [`connection.create()`](#connectioncreateoptions)\n- [`schema()`](#schemaoptions)\n- [`schema.createTable()`](#schemacreatetableoptions)\n- [`type()`](#typeoptions)\n- [`model()`](#modeloptions)\n- [`Model.create()`](#modelcreateattributes)\n- [`Model.findOne()`](#modelfindoneoptions-callback)\n- [`Model.find()`](#modelfindoptions-callback)\n- [`Model.destroy()`](#modeldestroyoptions-callback)\n- [`model.set()`](#modelsetattributes)\n- [`model.get()`](#modelgetattribute)\n- [`model.save()`](#modelsavecallback)\n- [`model.destroy()`](#modeldestroycallback)\n- [`model.toJSON()`](#modeltojson)\n- [`collection.toJSON()`](#collectiontojson)\n- [`collection.models`](#collectionmodels)\n\n### `connect(options)`\n\nSets the default [DynamoDB client](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/Client.html) for your application. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables).\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `connection.client`\n\nThe default DynamoDB client.\n\n### `connection.create(options)`\n\nCreates a DynamoDB client to be used at your will.\n\n```js\nvar client = dino.connection.create({\n    accessKeyId: 'YOUR_OTHER_KEY',\n    secretAccessKey: 'YOUR_OTHER_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `schema(options)`\n\nCreates a schema.\n\n```js\nvar forumSchema = dino.schema({\n    table: 'forums',\n    attributes: {\n        name: dino.types.string,\n        category: dino.types.string\n    },\n    key: {\n        hash: 'name'\n    }\n});\n```\n\n#### options\n\n- `table` (required)\n- `attributes` (required)\n- `key` (required)\n- `keyDelimiter`\n\n#### types\n\n- `boolean`\n- `date`\n- `id`\n- `number`\n- `object`\n- `string`\n\n### schema.createTable(options);\n\nCreates a table in DynamoDB.\n\n```js\nforumSchema.createTable({\n    readUnits: 5,\n    writeUnits: 2\n}, function(err, units){  });\n```\n\n#### options\n\n- `client`\n- `readUnits`\n- `writeUnits`\n\n### type(options)\n\nCreates a schema type.\n\n```js\nvar myType = dino.type({\n    defaultValue: null,\n    serialize: function (val) { return val; },\n    deserialize: function (val) { return val; },\n    toJSON: function (val) { return val; }\n});\n```\n\n#### options\n\n- `defaultValue`\n- `serialize`\n- `deserialize`\n- `toJSON`\n\n### `model(options)`\n\nCreates a Model object. Use Model objects to create and query models.\n\n```js\nvar Forum = dino.model({\n    schema: forumSchema\n});\n```\n\n#### options\n\n- `schema` (required)\n- `client`\n\n### `Model.create(attributes)`\n\nCreates a model.\n\n```js\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n```\n\n### `Model.findOne(match[, callback])`\n\nQueries DynamoDB for a single model.\n\n```js\nForum.findOne({\n    name: 'Amazon DynamoDB'\n}, function(err, forum, units){  });\n```\n\n### `Model.find(options[, callback])`\n\nQueries DynamoDB for a collection of models.\n\n```js\nReply.find({\n    match: {\n        forum_name: 'Amazon DynamoDB',\n        thread_name: 'DynamoDB Thread 1'\n    }\n    take: 10\n}, function(err, replies, units){  });\n```\n\n#### options\n\n- `match` (required)\n- `skip`\n- `take`\n- `sortBy`\n\n### `Model.destroy(match[, callback])`\n\nDeletes a model from DynamoDB.\n\n```js\nForum.destroy({\n    name: 'Amazon DynamoDB'\n}, function(err, units){  });\n```\n\n### `model.set(attributes)`\n\nSets the model's attributes.\n\n```js\nforum.set({\n    name: 'Amazon S3'\n});\n```\n\n### `model.get(attribute)`\n\nGets the model's attributes.\n\n```js\nforum.get('name'); // 'Amazon S3'\n```\n\n### `model.save([callback])`\n\nSaves the model to DynamoDB.\n\n```js\nforum.save(function(err, units){  });\n```\n\n### `model.destroy([callback])`\n\nDeletes the model from DynamoDB.\n\n```js\nforum.destroy(function(err, units){  });\n```\n\n### `model.toJSON()`\n\nReturns the JSON serialized attributes of the model.\n\n```js\nforum.toJSON();\n```\n\n### `collection.toJSON()`\n\nReturns an array where each model in the collection has been JSON serialized.\n\n```js\nreplies.toJSON();\n```\n\n### `collection.models`\n\nThe raw array of models in the collection.\n\n```js\nreplies.models;\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## Changelog\n\n### 0.3.1 &mdash; [May 8, 2013](https://github.com/christophercliff/dino/compare/v0.3.1...v0.3.2)\n\n- Fixed regression where `Model.findOne()` would fail silently on tables w/o a range key.\n\n### 0.3.1 &mdash; [May 8, 2013](https://github.com/christophercliff/dino/compare/v0.3.0...v0.3.1)\n\n- Fixed regression where instance members weren't being assigned on `Model.create()`.\n\n### 0.3.0 &mdash; [May 5, 2013](https://github.com/christophercliff/dino/compare/v0.2.3...v0.3.0)\n\n- Migrated to DynamoDB API version 2012-08-10, which allows for secondary indexes. You can now query, sort and destroy by secondary index. Review the documentation on `find()`, `findOne`, and `destroy()` to see the changes to the API.","_id":"dino@0.3.2","dist":{"shasum":"6ef5eafeaab9c5551d3950051062e7759dc43296","tarball":"https://registry.npmjs.org/dino/-/dino-0.3.2.tgz","integrity":"sha512-61J0WZLo4l9imm1/lgnoLcYa8oWt5lqSot29kq1Zzw+s6sRbQv05vLC8N5u+wypqfN6acbgGt+MJD37BXpDnxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHCuyIL8PO2gQm91rlc4H3yZo5JOQHydv0H2k+FOtMZAiBw1+4RbvTlUqDHjC5cTgcSt5Hc08AFZDEaBzuooSJcuA=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.3.3":{"name":"dino","version":"0.3.3","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"1.0.0"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"_id":"dino@0.3.3","readme":"ERROR: No README.md file found!","dist":{"shasum":"0c25435845efb4292cc17091a76bd05535ae1817","tarball":"https://registry.npmjs.org/dino/-/dino-0.3.3.tgz","integrity":"sha512-Q4jPzmyccA9yvW/q9xV4SW9tcYRr72hbx1VsHTDLEPQqs/WanOxictbTU0dbWc7K5Ev+2XNR9QkLqyGX2Zf/Dw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHmpyO9WlW1PxXIiMgNVHZrHU5aCyBbwZjP9wwbZv5nGAiBvcjBZY5lJAD9/PDaqLO5m8skFPTZCNVbKXwkoIqlDvA=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.3.4":{"name":"dino","version":"0.3.4","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"1.0.0"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1","sinon":"~1.7.2"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"readme":"# Dino\n\nA simple [Amazon DynamoDB](http://aws.amazon.com/dynamodb/) object modeler for Node.js. Dino is designed to leverage the fast (and inexpensive) parts of the DynamoDB API by default. The complete [DynamoDB client](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB_20120810.html) is exposed for extensibility.\n\n[![Build Status](https://secure.travis-ci.org/christophercliff/dino.png?branch=master)](https://travis-ci.org/christophercliff/dino)\n\n## Usage\n\n```js\nvar dino = require('dino');\n\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n\nvar Forum = dino.model({\n    schema: dino.schema({\n        table: 'forums',\n        attributes: {\n            name: dino.types.string,\n            category: dino.types.string\n        },\n        key: {\n            hash: 'name'\n        }\n    })\n});\n\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n\nforum.save();\n```\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## API\n\n- [`connect()`](#connectoptions)\n- [`connection.client`](#connectionclient)\n- [`connection.create()`](#connectioncreateoptions)\n- [`schema()`](#schemaoptions)\n- [`schema.createTable()`](#schemacreatetableoptions)\n- [`type()`](#typeoptions)\n- [`model()`](#modeloptions)\n- [`Model.create()`](#modelcreateattributes)\n- [`Model.findOne()`](#modelfindonematch-callback)\n- [`Model.find()`](#modelfindoptions-callback)\n- [`Model.destroy()`](#modeldestroymatch-callback)\n- [`model.set()`](#modelsetattributes)\n- [`model.get()`](#modelgetattribute)\n- [`model.save()`](#modelsavecallback)\n- [`model.destroy()`](#modeldestroycallback)\n- [`model.toJSON()`](#modeltojson)\n- [`collection.toJSON()`](#collectiontojson)\n- [`collection.models`](#collectionmodels)\n\n### `connect(options)`\n\nSets the default DynamoDB client for your application. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables).\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `connection.client`\n\nThe default DynamoDB client.\n\n### `connection.create(options)`\n\nCreates a DynamoDB client to be used at your will.\n\n```js\nvar client = dino.connection.create({\n    accessKeyId: 'YOUR_OTHER_KEY',\n    secretAccessKey: 'YOUR_OTHER_SECRET',\n    region: 'us-east-1'\n});\n```\n\n#### options\n\n- `accessKeyId` (required)\n- `secretAccessKey` (required)\n- `region` (required)\n\n### `schema(options)`\n\nCreates a schema.\n\n```js\nvar forumSchema = dino.schema({\n    table: 'forums',\n    attributes: {\n        name: dino.types.string,\n        date_created: dino.types.date,\n        author: dino.types.string\n    },\n    key: {\n        hash: 'name',\n        range: 'date_created',\n        secondary: 'author'\n    }\n});\n```\n\n#### options\n\n- `table` (required)\n- `attributes` (required)\n- `key` (required)\n- `keyDelimiter`\n\n#### types\n\n- `boolean`\n- `date`\n- `id`\n- `number`\n- `object`\n- `string`\n\n### schema.createTable(options);\n\nCreates a table in DynamoDB.\n\n```js\nforumSchema.createTable({\n    readUnits: 5,\n    writeUnits: 2\n}, function(err){  });\n```\n\n#### options\n\n- `client`\n- `readUnits`\n- `writeUnits`\n\n### type(options)\n\nCreates a schema type.\n\n```js\nvar myType = dino.type({\n    defaultValue: null,\n    serialize: function (val) { return val; },\n    deserialize: function (val) { return val; },\n    toJSON: function (val) { return val; }\n});\n```\n\n#### options\n\n- `defaultValue`\n- `serialize`\n- `deserialize`\n- `toJSON`\n\n### `model(options)`\n\nCreates a Model object. Use Model objects to create and query models.\n\n```js\nvar Forum = dino.model({\n    schema: forumSchema\n});\n```\n\n#### options\n\n- `schema` (required)\n- `client`\n\n### `Model.create(attributes)`\n\nCreates a model.\n\n```js\nvar forum = Forum.create({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services'\n});\n```\n\n### `Model.findOne(match[, callback])`\n\nQueries DynamoDB for a single model.\n\n```js\nForum.findOne({\n    name: 'Amazon DynamoDB'\n}, function(err, forum, units){  });\n```\n\n### `Model.find(options[, callback])`\n\nQueries DynamoDB for a collection of models.\n\n```js\nReply.find({\n    match: {\n        forum_name: 'Amazon DynamoDB',\n        thread_name: 'DynamoDB Thread 1'\n    }\n    take: 10\n}, function(err, replies, units){  });\n```\n\n#### options\n\n- `match` (required)\n- `skip`\n- `take`\n- `sortBy`\n\n### `Model.destroy(match[, callback])`\n\nDeletes a model from DynamoDB.\n\n```js\nForum.destroy({\n    name: 'Amazon DynamoDB'\n}, function(err, units){  });\n```\n\n### `model.set(attributes)`\n\nSets the model's attributes.\n\n```js\nforum.set({\n    name: 'Amazon S3'\n});\n```\n\n### `model.get(attribute)`\n\nGets the model's attributes.\n\n```js\nforum.get('name'); // 'Amazon S3'\n```\n\n### `model.save([callback])`\n\nSaves the model to DynamoDB.\n\n```js\nforum.save(function(err, units){  });\n```\n\n### `model.destroy([callback])`\n\nDeletes the model from DynamoDB.\n\n```js\nforum.destroy(function(err, units){  });\n```\n\n### `model.toJSON()`\n\nReturns the JSON serialized attributes of the model.\n\n```js\nforum.toJSON();\n```\n\n### `collection.toJSON()`\n\nReturns an array where each model in the collection has been JSON serialized.\n\n```js\nreplies.toJSON();\n```\n\n### `collection.models`\n\nThe raw array of models in the collection.\n\n```js\nreplies.models;\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## Changelog\n\n### 0.3.3 &mdash; [May 9, 2013](https://github.com/christophercliff/dino/compare/v0.3.2...v0.3.3)\n\n- Applied `_.bindAll` to Model and Schema objects for easier flow control with [async](https://github.com/caolan/async).\n\n### 0.3.2 &mdash; [May 8, 2013](https://github.com/christophercliff/dino/compare/v0.3.1...v0.3.2)\n\n- Fixed regression where `Model.findOne()` would fail silently on tables w/o a range key.\n\n### 0.3.1 &mdash; [May 8, 2013](https://github.com/christophercliff/dino/compare/v0.3.0...v0.3.1)\n\n- Fixed regression where instance members weren't being assigned on `Model.create()`.\n\n### 0.3.0 &mdash; [May 5, 2013](https://github.com/christophercliff/dino/compare/v0.2.3...v0.3.0)\n\n- Migrated to DynamoDB API version 2012-08-10, which allows for secondary indexes. You can now query, sort and destroy by secondary index. Review the documentation on `find()`, `findOne`, and `destroy()` to see the changes to the API.\n","readmeFilename":"README.md","_id":"dino@0.3.4","dist":{"shasum":"29b2d0e20818f9b8215febb22321cfd965e20441","tarball":"https://registry.npmjs.org/dino/-/dino-0.3.4.tgz","integrity":"sha512-PVH6Kr1ooqS5djEXGFB6QMS8jED0GtDvALlFr5blRUUNm8u4aLejS8ySDJc5+11V/2h6EipHQjEMznpUsL+w6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGq+RAeBG+GqRVh86scdRBToS9O932FeH6ur/IIJZOODAiA7Q2Lo84EPAE6cvoVpuRi05tCSH4oy1DiXNvhT7qSG/Q=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]},"0.3.5":{"name":"dino","version":"0.3.5","author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"description":"A simple DynamoDB object modeler for Node.js.","keywords":["dino","dynamodb","aws","nosql","orm","odm","modeler"],"license":"MIT","scripts":{"test":"./node_modules/mocha/bin/mocha"},"dependencies":{"node-uuid":"1.4.0","moment":"1.7.2","underscore":"1.4.3","aws-sdk":"1.0.0"},"devDependencies":{"mocha":"1.7.4","should":"1.2.1","sinon":"~1.7.2"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"},"bugs":{"url":"https://github.com/christophercliff/dino/issues"},"_id":"dino@0.3.5","readme":"ERROR: No README.md file found!","dist":{"shasum":"639f9fa2d9a774411a035e3f50564d8f58fbfc08","tarball":"https://registry.npmjs.org/dino/-/dino-0.3.5.tgz","integrity":"sha512-7VpT+T2J/lYbgqIVUfiUipJgUNJNbOIlbhZv9zFjHKtcxKO1Lz9f/pnzVJuiExkzcQ91wU/V02JWpKNwS/wesQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqSIxQ9EjUJlCeCYiM0OO1EayJxPOaHX3Nv6QFUnCeXAiEAuPpGBsvhXmfB5PvfQpctSXWAPtiwfS92ROW8c1MuND4="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"christophercliff","email":"ctcliff@gmail.com"},"maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}]}},"readme":"# Dino\n\nA simple DynamoDB object modeler for node.js.\n\n## Installation\n\n```\n$ npm install dino\n```\n\n## Usage\n\nCross-ref with [Amazon's sample data](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SampleTablesAndData.html):\n\n### Connect\n\nCreates a DynamoDB client using your credentials. Alternatively, you can omit this and [use environment variables](http://docs.aws.amazon.com/nodejs/latest/dg/configuration-guide.html#nodejs-dg-credentials-from-environment-variables) instead.\n\n```js\ndino.connect({\n    accessKeyId: 'YOUR_KEY',\n    secretAccessKey: 'YOUR_SECRET',\n    region: 'us-east-1'\n});\n```\n\n### Schema\n\nSets the table, property types and primary keys.\n\n```js\nvar table = 'forums',\n    attributes = {\n        name: String,\n        category: String,\n        thread_count: Number,\n        view_count: Number,\n        last_post_author: String,\n        last_post_date: Date\n    },\n    key = {\n        hash: 'name'\n    },\n    schema = new dino.Schema(table, attributes, key);\n```\n\n### Model\n\nExtend `dino.Model` to create a model definition. All models require an instance of `dino.Schema`.\n\n```js\nvar Forum = dino.Model.extend({\n    schema: new dino.Schema(table, attributes, key)\n});\n\nvar forum = new Forum({\n    name: 'Amazon DynamoDB',\n    category: 'Amazon Web Services',\n    thread_count: 3,\n    view_count: 4,\n    last_post_author: 'User A',\n    last_post_date: moment.utc()\n})\n```\n\n#### save\n\nSaves the model.\n\n```js\nforum.save(function(err, units){\n    \n});\n```\n\n#### destroy\n\nDeletes the model.\n\n```js\nforum.destroy(function(err, units){\n    // (poof)\n});\n```\n\n#### find\n\nReturns an array of model instances.\n\n```js\n// Find the first page of replies for a thread\nReply.find({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    skip: 0,\n    take: 10\n}, function(err, forums, units){\n    \n});\n```\n\nQuery parameters:\n\n- hash (required)\n- range\n- skip\n- take\n\n#### findOne\n\nReturns a single model by hash and/or range key.\n\n```js\nForum.findOne({\n    hash: 'Amazon DynamoDB'\n}, function(err, forum, units){\n    \n});\n\nReply.findOne({\n    hash: ['Amazon DynamoDB', 'DynamoDB Thread 1'],\n    range: '2011-12-11T00:40:57.165Z'\n}, function(err, reply, units){\n    \n});\n```\n\n#### toJSON\n\nReturns a JSON-like representation of an model's properties.\n\n```js\nforum.toJSON();\n\n//  {\n//    name: 'Amazon DynamoDB',\n//    category: 'Amazon Web Services',\n//    thread_count: 3,\n//    view_count: 4,\n//    last_post_author: 'User A',\n//    last_post_date: [Object]\n//  }\n```\n\n### Key Smushing\n\nDynamoDB's [Query API](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API_Query.html) allows you to query by hash and range primary keys. To create more complex queries, you can combine multiple attributes into a single key. Dino accepts arrays as key definitions and will combine and parse these attributes automatically.\n\n```js\nvar table = 'threads',\n    attributes = {\n        forum_name: String,\n        subject: Number\n    },\n    key = {\n        hash: ['forum_name', 'subject'] // smush together\n    },\n    Thread = dino.Model.extend({\n        schema: new dino.Schema(table, attributes, key)\n    });\n\nnew Thread({\n    forum_name: 'Amazon DynamoDB',\n    subject: 'DynamoDB Thread 1'\n}).save();\n\n// \"forum_name#subject\": \"Amazon DynamoDB#DynamoDB Thread 1\"\n```\n\n## Tests\n\nInstall the dependencies and run.\n\n```\n$ npm install\n$ npm test\n```\n\n## License\n\nCopyright (C) 2013 Christopher Cliff\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","maintainers":[{"name":"christophercliff","email":"ctcliff@gmail.com"}],"time":{"modified":"2022-06-15T04:17:48.412Z","created":"2013-03-15T21:50:24.558Z","0.0.1":"2013-03-15T21:50:25.499Z","0.1.0":"2013-03-18T20:31:34.678Z","0.1.1":"2013-03-19T00:30:28.268Z","0.1.2":"2013-03-23T21:46:37.094Z","0.2.0":"2013-04-09T21:51:40.575Z","0.2.1":"2013-04-09T23:13:31.973Z","0.2.2":"2013-04-29T01:03:21.630Z","0.2.3":"2013-05-03T23:48:00.602Z","0.3.0":"2013-05-05T17:32:16.873Z","0.3.1":"2013-05-09T00:03:45.940Z","0.3.2":"2013-05-09T01:44:30.836Z","0.3.3":"2013-05-10T02:37:42.200Z","0.3.4":"2013-05-26T16:39:15.536Z","0.3.5":"2013-05-28T22:37:25.816Z"},"author":{"name":"Christopher Cliff","email":"ctcliff@gmail.com"},"repository":{"type":"git","url":"http://github.com/christophercliff/dino"}}