{"id":20205301,"url":"https://github.com/antyfive/teo-db-adapter-mongoose","last_synced_at":"2026-05-13T09:02:02.808Z","repository":{"id":65515434,"uuid":"73892032","full_name":"Antyfive/teo-db-adapter-mongoose","owner":"Antyfive","description":"Mongoose adapter for Teo.JS","archived":false,"fork":false,"pushed_at":"2017-02-12T18:10:54.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T08:46:53.370Z","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/Antyfive.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-11-16T06:45:26.000Z","updated_at":"2016-11-16T20:29:08.000Z","dependencies_parsed_at":"2023-01-26T21:25:11.391Z","dependency_job_id":null,"html_url":"https://github.com/Antyfive/teo-db-adapter-mongoose","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/Antyfive%2Fteo-db-adapter-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antyfive%2Fteo-db-adapter-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antyfive%2Fteo-db-adapter-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antyfive%2Fteo-db-adapter-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Antyfive","download_url":"https://codeload.github.com/Antyfive/teo-db-adapter-mongoose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644545,"owners_count":19996177,"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-11-14T05:16:51.529Z","updated_at":"2025-11-29T09:03:59.990Z","avatar_url":"https://github.com/Antyfive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# teo-db-adapter-mongoose\nMongoose adapter for [Teo.JS](https://github.com/Antyfive/teo.js).\n## Installation\n`npm i -S teo-db-adapter-mongoose`\n## Usage Example\n```javascript\nconst MongooseAdapter = require(\"teo-db-adapter-mongoose\");\nconst adapter = new MongooseAdapter({\n  // this config is usually set in Teo.JS configuration file\n  host: \"localhost\",\n  dbName: \"test\"\n});\n```\nExample of the real model, which can be created in Teo.JS application.\n```javascript\nconst identity = \"test\";\nconst Schema = require('mongoose').Schema;\n\nconst schema = new Schema({\n    title:  String,\n    author: String,\n    body:   String,\n    comments: [{ body: String, date: Date }],\n    date: { type: Date, default: Date.now },\n    hidden: Boolean,\n    meta: {\n        votes: Number,\n        favs:  Number\n    }\n});\n\nmodule.exports = {identity, schema};\n```\nEach model should have **identity**, and **schema** properties. To add a model directly via this API, call `adapter.addModel({idenity: 'users', schema: new Mongoose.Schema({/**/})})`.\n\n### API\n\n#### addModel([shemaObject{}])\n#### connect() [generator function]\nConnects ORM. All models should be loaded **before** the connection to DB.\n#### disconnect() [generator function]\nDisconnects ORM.\n#### isConnected()\nReturns `boolean` to detect if connection is set.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantyfive%2Fteo-db-adapter-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantyfive%2Fteo-db-adapter-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantyfive%2Fteo-db-adapter-mongoose/lists"}