I am trying to fetch the details from the MongoDB where value of a particular attribute is either a or b. For example, In my collection Test(Attr_A, Attr_B, Attr_C) get the record where value of Attr_C is either "x" or "y".
Filter Query:
filter := bson.M{"Attr_A": "123", "Attr_B": "456",
"$in": bson.A{bson.D{{"Attr_C", "x"}},
bson.D{{"Attr_C", "y"}}}}
result := repo.DBPlug.Get("Test", filter)
Error I am getting is,
(BadValue) unknown top level operator: $in. If you have a field name that starts with a '$' symbol, consider using $getField or $setField.