Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mq

Translates http query string to mongodb query (Heavily inspired by tower.js controllers. For those who search for something lighter and independent)

1. Strings (not implemented yet)

name=John
name=John+Doe
name='John+Doe'
{"name": { "$match" : ["John"] } }
{"name": { "$match" : ["John", "Doe"] } }
{"name": { "$match" : ["John Doe"] } }

2. Numbers (not implemented yet)

stars=1
stars=1..
stars=..5
stars=1..5
{"stars": 1}
{"stars": { "$gte": 1 } }
{"stars": { "$lte": 5 } }
{"stars": { "$gte": 1, "$lte": 5 } }

3. Arrays (not implemented yet)

tags=coffee,
tags=coffee,vodka
{"tags" : { "$in" : ["coffee"] } }
{"tags" : { "$in" : ["coffee", "vodka"] } }

Please note that , is important in the first case dates

About

Translates http query string to mongoose query string

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors