{"library":"mongodb-database-model","title":"MongoDB Database Model","description":"MongoDB database model class for Compass. Provides a structured representation of a MongoDB database, including collections, indexes, and schema analysis. Version 2.35.0 is the current stable release, part of the MongoDB Compass ecosystem. Built with TypeScript, it offers type-safe database modeling and is used internally by Compass. Infrequently updated, with no known breaking changes in recent versions. Key differentiator: tailored for Compass internal use; not intended for general-purpose MongoDB modeling outside that context.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install mongodb-database-model"],"cli":null},"imports":["import { Model } from 'mongodb-database-model'","import { createModel } from 'mongodb-database-model'","import DatabaseModel from 'mongodb-database-model'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createModel } from 'mongodb-database-model';\n\n// Create a model from a database info object\nconst dbModel = createModel({\n  _id: 'mydb',\n  name: 'mydb',\n  collections: ['users', 'orders'],\n  collection_count: 2,\n});\n\nconsole.log(dbModel.name); // 'mydb'\nconsole.log(dbModel.collections); // ['users', 'orders']\n","lang":"typescript","description":"Shows how to import and use the createModel factory to instantiate a DatabaseModel object with collections.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}