mgm icon indicating copy to clipboard operation
mgm copied to clipboard

Query builder

Open nchanged opened this issue 4 years ago • 2 comments

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.

nchanged avatar Nov 26 '20 09:11 nchanged

Thanks, @nchanged.

Yeah, a query builder can be a good idea and we'll try to implement it.

mehran-prs avatar Nov 27 '20 16:11 mehran-prs

Hi, I Wrote a sample demo here https://github.com/go-odm/odm/blob/master/query.go, which inspired https://github.com/aheckmann/mquery

WenyXu avatar May 31 '21 07:05 WenyXu