Turistforeningen / node-mongo-querystring

Query builder for accepting URL query parameters into your MongoDB queries. Safe and feature rich. Supports most of MongoDB's query operators such as $eq, $gt, $lt, $ne, $in, $nin, $exists, $regex, geospatial queries such as bbox and near, as well as your own custom query business logic!
MIT License
100 stars 31 forks source link

Parsing String 'null' #61

Closed JianChuanting closed 7 years ago

JianChuanting commented 7 years ago

How to parse key=null? Want to get null not 'null'.

Starefossen commented 7 years ago

Currently not possible. But pull request are always welcome, and you also become an official member of the project if you contribute 👍

Starefossen commented 7 years ago

It is possible with a custom function:

var qs = new MongoQS({
  custom: {
   myParam: function(query, input) {
      query.myParam = input === 'null' ? null : input;
    }
  }
});
JianChuanting commented 7 years ago

ok, thx!