{"id":17224747,"url":"https://github.com/thebergamo/k7-mongoose","last_synced_at":"2025-04-14T00:44:58.358Z","repository":{"id":57287937,"uuid":"52810744","full_name":"thebergamo/k7-mongoose","owner":"thebergamo","description":"K7 adapter for Mongoose ODM :squirrel:","archived":false,"fork":false,"pushed_at":"2017-03-20T19:33:50.000Z","size":22,"stargazers_count":3,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T14:55:06.436Z","etag":null,"topics":["hapi","hapi-plugin","k7","mongoose"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thebergamo.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-02-29T17:45:05.000Z","updated_at":"2017-04-24T21:00:04.000Z","dependencies_parsed_at":"2022-09-18T19:27:47.769Z","dependency_job_id":null,"html_url":"https://github.com/thebergamo/k7-mongoose","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebergamo%2Fk7-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebergamo%2Fk7-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebergamo%2Fk7-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebergamo%2Fk7-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thebergamo","download_url":"https://codeload.github.com/thebergamo/k7-mongoose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804721,"owners_count":21164127,"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","hapi-plugin","k7","mongoose"],"created_at":"2024-10-15T04:11:52.968Z","updated_at":"2025-04-14T00:44:58.340Z","avatar_url":"https://github.com/thebergamo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"k7-mongoose\n===\n`k7` adapter for mongoose ODM\n\n[![Build Status](https://travis-ci.org/thebergamo/k7-mongoose.svg)](https://travis-ci.org/thebergamo/k7-mongoose)\n\nLead Maintainer: [Marcos Bérgamo](https://github.com/thebergamo)\n\n## Example Usage\n\n```javascript\nconst Hapi = require('hapi');\nconst Server = new Hapi.Server();\n\nServer.connection({host: 'localhost'});\n\nlet options = {\n    adapter: require('k7-mongoose'),\n    connectionString: 'mongodb://localhost:27017/K7Mongoose',\n    promise: global.Promise\n};\n\nServer.register({\n    register: require('k7'),\n    options: options\n}, (err) =\u003e {\n    if (err) {\n        throw err;\n    }\n    \n    Server.start((err) =\u003e {\n        if (err) {\n            throw err;\n        }\n        \n        Server.log('info', 'Server running at: ' + Server.info.uri);\n    });\n});\n```\n\nThis example does the following: \n1. Setting the k7-mongoose adapter\n2. Setting the connectionString for mongoose connect\n3. Register the k7 to Hapi.js\n\n## Options\nAll the options available in [Mongoose][mongoose] can be setted in `connectionOptions`.\n\n## Set up the models\nYou can define your models schema like you're already do, but you need to replace the `const mongoose = require('mongoose');` on top of your models by update with `const mongoose = require('k7-mongoose').mongoose();`\n\n**Why this is required?** Because mongoose is a singleton, therefore you need to use the **k7-mongoose** instantiated version.\n\n[mongoose]: http://mongoosejs.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebergamo%2Fk7-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebergamo%2Fk7-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebergamo%2Fk7-mongoose/lists"}