{"repo":"monarch-orm/monarch","free":true,"listed":false,"github":"https://github.com/monarch-orm/monarch","clone":"git clone https://github.com/monarch-orm/monarch.git","description":"Monarch ORM: A type-safe Object Document Mapper (ODM) for MongoDB","language":"TypeScript","stars":31,"topics":["mongodb","mongoose","odm","orm","typesafe","typescript","backend","database","database-schema","developer-tools"],"license":"MIT","category":"databases-storage","readme_excerpt":"Monarch ORM Type-safe MongoDB collections, schema parsing, relations, and query helpers for TypeScript. Features - Strongly Typed: Infer schema inputs and outputs for queries and collection methods. - Flexible Schemas: Use transforms, defaults, validation, virtuals, renames, and default omit rules. - Typed Relations: Define one and many relations with typed population support. - Familiar MongoDB Access: Use typed query methods, operators, aggregation, and raw collection access. - Collection Initialization: Automatically initialize collections with indexes and JSON Schema validation, or do it manually. Installation Quick Start Schemas createSchema() defines a collection's shape. If you do not define id , it defaults to objectId() . When a schema uses ObjectId for id , Monarch makes the input optional for inserts. defineSchemas() normalizes schemas keyed by collection name. It also holds schema relations. Relations Use withRelations() on a schemas object to define typed relations. One relations Use one when a single local field points to a single document in another collection. Many relations Use many when one document relates to many documents in another collection. The from and to fields can each be a single value or an array, so you can model different relation patterns: - single → single — a foreign key on the target side ( user. id → post.authorId ) - single → array — the target embeds a list of references ( post. id → tag.postIds ) - array → single — the source embeds a l","default_branch":null,"files":null,"tree":[],"storefront":"/r/monarch-orm","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/monarch-orm/monarch/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}