mongo-query-sanitizer
v1.0.0
Published
Recursively remove the dollar prefix from object keys
Downloads
2
Maintainers
Readme
Mongo Query Sanitizer
Sanitizes objects by recursively removing the dolar prefix from object keys.
Returns a new object instead of directly mutating the original object.
Usage
Install the package from npm
$ npm install mongo-query-sanitizer
Sanitize queries
const sanitize = require('mongo-query-sanitizer')
const query = {
$set: { name: 'Foo' },
}
console.log(sanitize(query))
// {
// set: { name: 'Foo' },
// }
License
Copyright (c) 2017 Derek Willian Stavis MIT License