{"id":24383469,"url":"https://github.com/firstandthird/hapi-mongodb-collections","last_synced_at":"2025-06-19T21:33:39.693Z","repository":{"id":54297293,"uuid":"70900026","full_name":"firstandthird/hapi-mongodb-collections","owner":"firstandthird","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-25T22:30:32.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-30T10:16:17.671Z","etag":null,"topics":["hapi-plugin"],"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/firstandthird.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-14T10:28:55.000Z","updated_at":"2021-02-25T22:30:33.000Z","dependencies_parsed_at":"2022-08-13T11:20:23.519Z","dependency_job_id":null,"html_url":"https://github.com/firstandthird/hapi-mongodb-collections","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/firstandthird/hapi-mongodb-collections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-mongodb-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-mongodb-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-mongodb-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-mongodb-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstandthird","download_url":"https://codeload.github.com/firstandthird/hapi-mongodb-collections/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstandthird%2Fhapi-mongodb-collections/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260835642,"owners_count":23070321,"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":["hapi-plugin"],"created_at":"2025-01-19T10:14:33.707Z","updated_at":"2025-06-19T21:33:34.680Z","avatar_url":"https://github.com/firstandthird.png","language":"JavaScript","readme":"## hapi-mongodb-collections\n\nA [hapi](https://hapi.dev/) helper that makes it easier to access your mongodb collections.\n\nNo more\n```javascript\nserver.plugins['hapi-mongodb'].db.collection('myCollection').find({});\n```\n\ninstead you just do:\n\n```javascript\nserver.myCollection.find({});\n```\n\n## Installation\n\n```console\nnpm install hapi-mongodb-collections\n```\n\n## Use\n\nFirst make sure you have registered [hapi-mongodb](https://github.com/Marsup/hapi-mongodb)\nwith the server.  Then register hapi-mongodb-collections and specify the collections you want to make available directory from your server object.\n\n## Example\n\n```javascript\nconst plugin = require('hapi-mongodb-collections');\nawait server.register({\n  plugin,\n  options: {\n    collections: [\n      'myCoinCollection',\n      'myShellCollection',\n      'myStampCollection'\n    ]\n  }\n});\n```\n   will make it possible to do:\n\n```javascript\nawait server.myCoinCollection.find({ type: 'dimes' });\n```\n\n## Options\n\nOptions:\n- __collections__ (required)\n  An array of collection names.\n- __namespace__\n  If you want to put your collections under a namespace, you can.  So for example passing:\n  ```javascript\n  {\n    collections: [\n      'myCoinCollection'\n    ],\n    namespace: 'collections'\n  }\n  ```\n   in your plugin options will let you make queries like so:\n\n   ```javascript\n    server.collections.myCoinCollection.find({ type: \"dimes\" })\n   ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fhapi-mongodb-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstandthird%2Fhapi-mongodb-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstandthird%2Fhapi-mongodb-collections/lists"}