I would like to build a mongo query dynamic but searching in google, i don't understand why the first query returns null.
matches := []bson.M{bson.M{"$match": bson.M{"age": bson.M{"$gt": 20}}}}
err2 := coll.Find(matches).All(&persons)
This shows the expected rows:
err2 = coll.Find(bson.M{"age": bson.M{"$gt": 20}}).All(&persons)
Would you have a simple example how to build query with two parameter, please?
Thank you.