mongoqb is a versatile query builder for mongodb from http request built in golang.
Request Query | Monogo DB Query | Operators |
---|---|---|
filterBy=name&name=hari | bson.M{"name": "hari"} | None |
filterBy=name(and),emailId(or),age&name=hari,rahul,krishnan | bson.M{"name":bson.M{"$and": []string{"hari", "rahul", "krishnan"}}} | conditional operators |
- Build mongodb query from http request.
- Conditional operators in mongodb are allowed.
- Custom functions to do operations before making mongodb query.
- Only exported keys are allowed to transform into mongodb query.
mongoqb uses only one source projects to work properly:
- mgo - a powerfull golang mongodb driver.
mongoqb requires mgo v2 to run.
To install dependencies, run the below
go get gopkg.in/mgo.v2
Install mongoqb
go get github.com/hariprasadraja/mongoqb
- Need to add more examples.
- extend functionality to all operators
- paras query from request body. if the request is made via post call.
- parse query from the form request.