
Product
Redesigned Repositories Page: A Faster Way to Prioritize Security Risk
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
mongo-query-parse-filter
Advanced tools
Lightweight package that allows you to easily convert complex, human-readable query filters into MongoDB-compatible query syntax, supporting logical operations like `AND`, `OR`, `NOT`, `IN`, `NIN` and various comparison operators
Lightweight package that allows you to easily convert complex, human-readable query filters into MongoDB-compatible query syntax, supporting logical operations like AND
, OR
, NOT
, IN
, NIN
and various comparison operators
To install the package, use npm:
npm i mongo-query-parse-filter
const { MongoQuery } = require('mongo-query-parse-filter');
const mongoQuery = new MongoQuery();
const query = mongoQuery.buildQuery('(email eq "jhon@example.com")')
console.log(query)
{
"email": { "$eq": "jhon@example.com" }
}
(email regex "(?i)@example.com$")
{
"email": { "$regex": "(?i)@example.com$" }
}
(email eq "jhon@example.com") or (username eq "alice")
{
"$or": [
{
"email": { "$eq": "jhon@example.com" }
},
{
"username": { "$eq": "alice" }
}
]
}
(not ((department eq "Marketing") or (department eq "Sales")))
to find all employees who are not either in the Marketing or Sales departments
{
"$not": {
"$or": [
{
"department": { "$eq": "Marketing" }
},
{
"department": { "$eq": "Sales" }
}
]
}
}
(email in "'alice@example.com','jhon@example.com'")
{
"email": { "$in": [ "alice@example.com", "jhon@example.com"] }
}
FAQs
Lightweight package that allows you to easily convert complex, human-readable query filters into MongoDB-compatible query syntax, supporting logical operations like `AND`, `OR`, `NOT`, `IN`, `NIN` and various comparison operators
The npm package mongo-query-parse-filter receives a total of 13 weekly downloads. As such, mongo-query-parse-filter popularity was classified as not popular.
We found that mongo-query-parse-filter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Multiple deserialization flaws in PyTorch Lightning could allow remote code execution when loading untrusted model files, affecting versions up to 2.4.0.
Security News
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.