golang操作mongodb

在之前mgo是一个使用广泛的mongodb驱动器,不过从2018年开始已不再维护,虽然觉得怪可惜的,但也不推荐使用了,毕竟mongodb本身一直在迭代,如果驱动器不更新后续也没法使用。 详细说明见仓库:https://github.com/go-mgo/mgo

而mongodb提供了官方驱动,目前能找到的中文文档大多比较旧了,推荐直接看官方文档,有完整的操作手册:https://www.mongodb.com/blog/search/golang 本文也不想做一次搬运工,毕竟也不能随时保持更新,还是直接看官方文档比较好。下面列出一些主要的文章链接:

Stack Overflow Research of 100,000 Developers Finds MongoDB is the Most Wanted Database (2019-2-2)

Official MongoDB Go Driver Now Available for Beta Testing (2019-2-2) mongodb将为go提供官方驱动支持

MongoDB Go Driver Tutorial (2019-5-30) MongoDB Go驱动程序教程

Go Migration Guide (2019-2-2) 从社区驱动(mgo)迁移到官方驱动

MongoDB Stitch Functions – The AWS re:Invent Stitch Rover Demo(2019-10-15)

Calling the MongoDB Atlas API - How to do it from Go(2019-3-18)

MongoDB Go Driver Tutorial Part 1: Connecting, Using BSON, and CRUD Operations(2019-4-23)

Quick Start: Golang & MongoDB - Starting and Setup(2019-11-9)

Quick Start: Golang & MongoDB - How to Create Documents(2019-11-16) golang和mongodb创建文档

Quick Start: Golang & MongoDB - How to Update Documents(2020-1-15)

Quick Start: Golang & MongoDB - How to Read Documents(2019-11-22)

Quick Start: Golang & MongoDB - How to Delete Documents(2020-1-10)

Quick Start: Golang & MongoDB - A Quick Look at GridFS(2019-12-20)

Quick Start: Golang & MongoDB - Modeling Documents with Go Data Structures(2020-2-6)

Quick Start: Golang & MongoDB - Data Aggregation Pipeline(2020-2-20)