{"repo":"Kamva/mgm","free":true,"listed":false,"github":"https://github.com/Kamva/mgm","clone":"git clone https://github.com/Kamva/mgm.git","description":"Mongo Go Models (mgm) is a fast and simple MongoDB ODM for Go (based on official Mongo Go Driver)","language":"Go","stars":764,"topics":["go","mongo-go-models","mgm","mongodb","odm","model","mongo"],"license":"Apache-2.0","category":"data-pipelines","readme_excerpt":"Mongo Go Models The Mongo ODM for Go - Features - Requirements - Installation - Usage - Bugs / Feature Requests - Communicate With Us - Contributing - License Features - Define your models and perform CRUD operations with hooks before/after each operation. - mgm makes Mongo search and aggregation super easy to do in Golang. - Just set up your configs once and get collections anywhere you need them. - mgm predefines all Mongo operators and keys, so you don't have to hardcode them yourself. - mgm wraps the official Mongo Go Driver. Requirements - Go 1.22 or higher. - MongoDB 4.0 and higher (required by the official driver v2). Upgrading to the mongo-driver v2 based release mgm now wraps go.mongodb.org/mongo-driver/v2 . If you're upgrading from a release based on driver v1, note these breaking changes: - Import go.mongodb.org/mongo-driver/v2/... instead of go.mongodb.org/mongo-driver/... . - primitive.ObjectID is now bson.ObjectID (the bson/primitive package was removed in v2). - TransactionFunc receives (session mongo.Session, sc context.Context) instead of (session mongo.Session, sc mongo.SessionContext) . - Collection and operation options use the driver's builder API (e.g. options.FindOne().SetComment(...) ); bare option struct pointers are no longer accepted. Installation Usage To get started, import the mgm package and setup the default config: Define your model: Insert new document: Find one document Update a document Delete a document Find and decode a result: A Model's ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Kamva","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Kamva/mgm/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."}