{"id":15190630,"url":"https://github.com/cludden/mycro-mongoose","last_synced_at":"2026-02-10T16:31:51.937Z","repository":{"id":57306523,"uuid":"44496362","full_name":"cludden/mycro-mongoose","owner":"cludden","description":null,"archived":false,"fork":false,"pushed_at":"2016-05-25T21:02:25.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T12:51:30.088Z","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":"mit","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":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-18T21:01:42.000Z","updated_at":"2016-01-22T04:58:13.000Z","dependencies_parsed_at":"2022-08-28T21:10:22.613Z","dependency_job_id":null,"html_url":"https://github.com/cludden/mycro-mongoose","commit_stats":null,"previous_names":["cludden/restify-microservice-mongoose"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cludden/mycro-mongoose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cludden","download_url":"https://codeload.github.com/cludden/mycro-mongoose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fmycro-mongoose/sbom","scorecard":{"id":293646,"data":{"date":"2025-08-11","repo":{"name":"github.com/cludden/mycro-mongoose","commit":"54ce741b33f4b3e0ad8242afaf12c24165aa901b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T18:55:54.774Z","repository_id":57306523,"created_at":"2025-08-17T18:55:54.774Z","updated_at":"2025-08-17T18:55:54.774Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29307904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T16:09:25.305Z","status":"ssl_error","status_checked_at":"2026-02-10T16:08:52.170Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-09-27T20:43:10.723Z","updated_at":"2026-02-10T16:31:51.908Z","avatar_url":"https://github.com/cludden.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mycro-mongoose\na [mongoose.js](http://mongoosejs.com) adapter for [mycro](https://github.com/cludden/mycro)\n\n\n## Install\n```javascript\nnpm install --save mycro-mongoose\n```\n\n\n## Getting Started\nFirst, make sure both the `connections` and `models` hooks are enabled. (These are enabled by default, however, if you've defined your own `/config/hooks.js` file, make sure it includes both of these)\n```javascript\n// in /config/hooks.js\nmodule.exports = [\n    // ..\n    'connections',\n    'models'\n    // ..\n]\n```\n\nThen, define one or more `mongoose` connections\n```javascript\n// in /config/connections.js\n\nvar mongooseAdapter = require('mycro-mongoose');\n\nmodule.exports = {\n    // ..\n    mongo: {\n        adapter: mongooseAdapter,\n        config: {\n            host: process.env.MONGO_HOST || 'localhost',\n            port: process.env.MONGO_PORT || 27017,\n            user: process.env.MONGO_USER,\n            password: process.env.MONGO_PASSWORD,\n            database: process.env.MONGO_DATABASE\n        }\n    },\n    // ..\n};\n```\n\n\nNext, define a mongoose model\n```javascript\n// in /app/models/post.js\n\nmodule.exports = function(connection, Schema) {\n    let options = {\n        collection: 'posts'\n    };\n\n    let schema = new Schema({\n          title:  String,\n          author: {\n              type: Schema.Types.ObjectId,\n              ref: 'users'\n          },\n          body:   String,\n          comments: [{\n              body: String,\n              date: Date\n          }],\n          date: {\n              type: Date,\n              default: Date.now\n          },\n          hidden: Boolean,\n          meta: {\n                votes: Number,\n                favs:  Number\n          }\n    });\n\n    return connection.model('post', blogSchema);\n}\n```\n\n\nLastly, use it in your app!\n```javascript\n// in /app/controllers/post.js\n\nmodule.exports = {\n    findPosts(req, res) {\n        var Posts = req.mycro.models['post'];\n\n        Posts.find({\n            hidden: false,\n            date: {\n                $lte: new Date()\n            }\n        }, function(err, posts) {\n            if (err) {\n                return res.json(500, {error: err});\n            }\n            res.json(200, {data: posts});\n        });\n    }\n}\n```\n\n## Config\nThe connection configuration object is described in more detail below\n```javascript\n// in config/connections.js\nconst mongooseAdapter = require('mycro-mongoose');\n\nmodule.exports = {\n    // ..\n    mongo: {\n        // in order to specify a mongodb connection, use this adapter as the adapter object\n        adapter: mongooseAdapter,\n\n        // all config is specified in the 'config' top level key. the key can be an object\n        // or a synchronous function (executed at runtime) that is passed the mycro instance and expects\n        // a config object in return\n        config: {\n            // either a valid mongodb url connection string can be provided\n            url: 'mongodb://sampleuser:correct-horse-batter-staple@localhost:27017/test',\n\n            // or the following are used to build a valid connection string\n            host: 'localhost'\n            port: 27017,\n            user: 'sampleuser',\n            password: 'correct-horse-batter-staple',\n            database: 'test'\n\n            // any additional connection options can be specified in an optional 'options' keys\n            options: {\n                replSet: {\n                    sslValidate: false\n                }\n            }\n        }\n    }\n    // ..\n}\n```\n\n## Testing\nrunning the tests:\n1. Update the connection info in `test/test-app/config/connections.js`\n2. Run the `mongod` server\n3. `npm test`\n\n\nto view coverage:  \n1. Update the connection info in `test/test-app/config/connections.js`\n2. Run the `mongod` server\n3. `grunt coverage`\n\n\n## Contributing\n1. [Fork it](https://github.com/cludden/mycro-mongoose/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\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","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcludden%2Fmycro-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcludden%2Fmycro-mongoose/lists"}