Minimal mingo port for Go projects, based on https:/kofrasa/mingo
$ go get github.com/codepushr/go-mingo
- Query Operators
- $eq, $gt, $gte, $lt, $lte, $and
Import go-mingo, create a query and run Test()
on it.
import "github.com/codepushr/go-mingo"
func main() {
q := mingo.Query{Criteria: mingo.Object{
"type": "ranking",
"$and": []mingo.Object{
mingo.Object{
"score": mingo.Object{
"$gt": 5,
},
},
},
}}
result := q.Test(mingo.Object{
"type": "ranking",
"score": 10,
})
}
- Support Dot Notation for both
<array>.<index>
and<document>.<field>
selectors
MIT