| Operator | Description | | -------- | ------------------ | | $ne | not equal | | $regex | regular expression | | $gt | greater than | | $lt | lower than | | $nin | not in | Example: A web application has a product search feature
db.products.find({ "price": userInput })An attacker can inject a NoSQL query: `{ "$gt": 0 }`.
db.products.find({ "price": { "$gt": 0 } })Instead of returning a specific product, the database returns all products with a price greater than zero, leaking data.
Source: NoSQL Injection/README.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.