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!
https://github.com/Turistforeningen/node-mongo-querystring/blob/9e3554c2b1ea09a0845ae0526647ca5da21d33d4/index.js#L184
this.valRegex
notthis.valReqex
^
and$
a few lines belowret.value = `^${ret.value}`;
insteadescapeRegex: true
might be more appropriate hereescapeRegexChars: /[\\^$.*+?()[\]{}|]/g
, where uses.replace(this.escapeRegexChars, '\\$&')
to escape (source: lodash _.escapeRegex)