mgm
mgm copied to clipboard
Query builder
Hey, first of all, great project!
Is your feature request related to a problem? Please describe. One of the most annoying things about MongoDB and GOlang is querying.
Describe the solution you'd like I would like to see a query build that is simple enough and doesn't involve bson. For example
q := Query("field1", "value1") // optional "and"
q.And("field2", "value2").And("field3", "value3")
.And(Query("foo1", "v1").Or("foo2", "v2"))
This would greatly simplify most generic queries.
Thanks, @nchanged.
Yeah, a query builder can be a good idea and we'll try to implement it.
Hi, I Wrote a sample demo here https://github.com/go-odm/odm/blob/master/query.go, which inspired https://github.com/aheckmann/mquery