So here is my question. I have an array which are stored the _ids of mongodbs objects. Whats the right way to retrieve them all in one query using the mgo and b
_ids
MongoDB syntax for go.mongodb.org/mongo-driver has been updated, this should work using the official driver.
oids := make([]primitive.ObjectID, len(ids)) for i := range ids { objID, err := primitive.ObjectIDFromHex(ids[i]) if err == nil { oids = append(oids, objID) } }