{"repo":"mongodb/mongo-go-driver","free":true,"listed":false,"github":"https://github.com/mongodb/mongo-go-driver","clone":"git clone https://github.com/mongodb/mongo-go-driver.git","description":"The Official Golang driver for MongoDB","language":"Go","stars":8535,"topics":["database","driver","go","golang","golang-library","mongodb"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"MongoDB Go Driver The MongoDB supported driver for Go. See the following resources to learn more about upgrading from version 1.x to 2.0.: - v2.0 Migration Guide - v2.0 What's New The MongoDB Go Driver follows semantic versioning for its releases. Requirements - Go 1.25 or higher. The Go Driver supports the last two Go minor versions. - Go 1.26 or higher is required to run the driver test suite. - MongoDB 4.4 and higher. Installation The recommended way to get started using the MongoDB Go Driver is by using Go modules to install the dependency in your project. This can be done either by importing packages from go.mongodb.org/mongo-driver and having the build step install the dependency or by explicitly running Usage To get started with the driver, import the mongo package and create a mongo.Client with the Connect function: Make sure to defer a call to Disconnect after instantiating your client: For more advanced configuration and authentication, see the documentation for mongo.Connect. Calling Connect does not block for server discovery. If you wish to know if a MongoDB server has been found and connected to, use the Ping method: To insert a document into a collection, first retrieve a Database and then Collection instance from the Client : The Collection instance can then be used to insert documents: To use bson.D , you will need to add \"go.mongodb.org/mongo-driver/v2/bson\" to your imports. Your import statement should now look like this: Several query methods return a curs","default_branch":null,"files":null,"tree":[],"storefront":"/r/mongodb","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mongodb/mongo-go-driver/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."}