Hey everyone! I am new to MongoDB.
I read the MongoDB Golang driver document, I found that we can use client.Database().Collection().InsertMany()
to insert some data. But if the query sends by frontend, how can I execute the plain query likes db.collection.find().pretty()
?
Thanks a lot.
@oysterdays if you’re asking about how to run a find
operation with the Go driver, check out the Find
example from the Go Driver docs. That example uses a filter to only match documents where type
is "Oolong"
, but you can find all documents by replacing that filter with an empty filter (e.g. bson.D{}
).