{"_id":"@drdanryan/mongoose-api-routes","_rev":"5-a6b482377600b2425a1b77ef87e7043d","name":"@drdanryan/mongoose-api-routes","description":"Generate Express API routes from a Mongoose model","dist-tags":{"latest":"1.2.1"},"versions":{"1.2.0":{"name":"@drdanryan/mongoose-api-routes","version":"1.2.0","description":"Generate Express API routes from a Mongoose model","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/DrDanRyan/mongoose-api-routes.git"},"keywords":["Mongoose","Express"],"author":{"name":"Dan Ryan"},"license":"ISC","bugs":{"url":"https://github.com/DrDanRyan/mongoose-api-routes/issues"},"homepage":"https://github.com/DrDanRyan/mongoose-api-routes","dependencies":{"express":"^4.12.4","lodash":"*"},"gitHead":"b17ea04963ea08413acdd3ccdc8b317b0beea525","_id":"@drdanryan/mongoose-api-routes@1.2.0","_shasum":"d19bf165b0033bcfe62bdcd162b80d59c9858a4a","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"drdanryan","email":"danryanfl@yahoo.com"},"dist":{"shasum":"d19bf165b0033bcfe62bdcd162b80d59c9858a4a","tarball":"https://registry.npmjs.org/@drdanryan/mongoose-api-routes/-/mongoose-api-routes-1.2.0.tgz","integrity":"sha512-mLsqsdTqoc3O5QE7YRRFvkRBmKf5TR8VeKLgcCYgbc7Vhbkz14tubL7AzmTPnpyBdby7d/C+v1q5rrE3V4rDLw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3KZbZbiOf+7r/j3WHGoGYEy1a4NwQj8UcAMEWqLncXwIhANK6zfEZVVzJSu4h3drpgS7PwHX+QuiegRzy7JGZkHMF"}]},"maintainers":[{"name":"drdanryan","email":"danryanfl@yahoo.com"}],"deprecated":"no longer supported"},"1.2.1":{"name":"@drdanryan/mongoose-api-routes","version":"1.2.1","description":"Generate Express API routes from a Mongoose model","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/DrDanRyan/mongoose-api-routes.git"},"keywords":["Mongoose","Express"],"author":{"name":"Dan Ryan"},"license":"ISC","bugs":{"url":"https://github.com/DrDanRyan/mongoose-api-routes/issues"},"homepage":"https://github.com/DrDanRyan/mongoose-api-routes","dependencies":{"express":"*","lodash":"*"},"gitHead":"da6bc0c4640774a37cd5eca539ffe4277a913f26","_id":"@drdanryan/mongoose-api-routes@1.2.1","_shasum":"024a23da46e28fb4ea6410311ae93f6798610f3a","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"drdanryan","email":"danryanfl@yahoo.com"},"dist":{"shasum":"024a23da46e28fb4ea6410311ae93f6798610f3a","tarball":"https://registry.npmjs.org/@drdanryan/mongoose-api-routes/-/mongoose-api-routes-1.2.1.tgz","integrity":"sha512-hXDomw+XYdHiaLDbX91zykQUNhjE73dBgbD2Db3rQwh7ng5GS7CiaZhlcqdg14IOo0qG7WRoiy86kcrUoiekUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAYxFnB36Nmwg4xR6dzFaH8dUJ33zhwRT373ggsd1d+WAiEA2s2TtfjM9s8+E4p5CP2034fWr98n4OeTarIBLVpnjGA="}]},"maintainers":[{"name":"drdanryan","email":"danryanfl@yahoo.com"}],"deprecated":"no longer supported"}},"readme":"# Create API Routes for a Mongoose Model\nThis module allows the easy creation of api routes to perform basic CRUD operations with advanced query functionality. To use, simply inject the mongoose model into this module and get a configured Express router as a return value. Mount this router at a path unique to the mongoose model.\n\nAn example:\n```javascript\nvar express = require('express');\nvar mongoose = require('mongoose');\nvar apiRoutes = require('mongoose-api-routes');\n\nvar app = express();\nmongoose.connect('your connection string here');\n\n// Instantiate mongoose models\nvar User = require('./user-model')(mongoose);\nvar Post = require('./post-model')(mongoose);\n\n// Mount api routes\napp.use('/users', apiRoutes(User));\napp.use('/posts', apiRoutes(Post));\n```\n\n## The Routes\nThe following routes are provided:\n\n#### Get all documents\nGET '/'\n\n#### Create a new document\nPOST '/' with new document in `req.body`\n\n#### Update an existing document\nPUT '/:id' with updated document in `req.body`\n\n#### Delete an existing document\nDELETE '/:id'\n\n#### Get an existing document by `id`\nPUT 'find/:id' with query options in `req.body`\n\nQuery options have the following form:\n```javascript\n  {\n    lean: <Boolean> // defaults to true,\n    select: <Object, String> // same format as mongoose select query method\n    populate: <Object, String> // same format as mongoose populate query method 1st arg\n    pick: String[] // array of property names to pick after query returns (useful for selecting virtual paths)MM\n  }\n```\n","maintainers":[{"name":"drdanryan","email":"danryanfl@yahoo.com"}],"time":{"modified":"2022-06-12T17:21:32.582Z","created":"2015-12-23T19:30:47.307Z","1.2.0":"2015-12-23T19:30:47.307Z","1.2.1":"2016-01-27T14:51:32.823Z"},"homepage":"https://github.com/DrDanRyan/mongoose-api-routes","keywords":["Mongoose","Express"],"repository":{"type":"git","url":"git+https://github.com/DrDanRyan/mongoose-api-routes.git"},"author":{"name":"Dan Ryan"},"bugs":{"url":"https://github.com/DrDanRyan/mongoose-api-routes/issues"},"license":"ISC","readmeFilename":"readme.md"}