{"id":16260014,"url":"https://github.com/cludden/mycro-mongoose-rest","last_synced_at":"2025-04-08T13:49:06.745Z","repository":{"id":57306527,"uuid":"47629000","full_name":"cludden/mycro-mongoose-rest","owner":"cludden","description":null,"archived":false,"fork":false,"pushed_at":"2016-01-22T16:23:02.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-15T23:36:11.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cludden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-08T14:58:22.000Z","updated_at":"2016-01-22T01:39:38.000Z","dependencies_parsed_at":"2022-08-28T21:10:27.400Z","dependency_job_id":null,"html_url":"https://github.com/cludden/mycro-mongoose-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cludden","download_url":"https://codeload.github.com/cludden/mycro-mongoose-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247854391,"owners_count":21007325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T16:06:03.533Z","updated_at":"2025-04-08T13:49:06.709Z","avatar_url":"https://github.com/cludden.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mycro-mongoose-rest\na [restify-mongoose](https://github.com/saintedlama/restify-mongoose) hook for [mycro](https://github.com/cludden/mycro)\n\n\n**NOTE** *This is still very much a work in progress and is not yet suitable for use in production*\n## Install\n```javascript\nnpm install --save mycro-mongoose-rest\n```\n\n## General Usage\n1. Define a config file at `/config/restify-mongoose.js`\n2. Define a `defaults` attribute that defines the default options for `restify-mongoose`\n3. Define a `models` attribute with a key for every model that you intend to create a `restify-mongoose` resource for.\n\n```javascript\n// in /config/restify-mongoose.js\n\nmodule.exports = {\n    // define default options for all models\n    defaults: {\n        pageSize: 20,\n        baseUrl: 'https://www.example.com/api'\n    }\n\n    models: {\n        // use defaults for `group` model\n        group: true,\n\n        // define additional options for `user` model\n        user: {\n            // define options that will be applied to all Resource methods\n            defaults: {\n                detailProjection: function(req, item, cb) {\n                    cb(null, item.toObject());\n                },\n                filter: function(req, res) {\n                    return { status: 'active' };\n                },\n                listProjection: function(req, item, cb) {\n                    cb(null, item.toObject());\n                }\n            },\n            // define options that will be applied to the `query` method\n            query: {\n                sort: '-first'\n            }\n        }\n    }\n}\n```\n\n## Contributing\n1. [Fork it](https://github.com/cludden/mycro-mongoose-rest/fork)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\nCopyright (c) 2015 Chris Ludden.\nLicensed under the [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcludden%2Fmycro-mongoose-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcludden%2Fmycro-mongoose-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcludden%2Fmycro-mongoose-rest/lists"}