MongoDB

Mongodb Queries

You can write JSON that represent your Mongo queries. You can add params to your queries, updates or inserts by adding $ in front of named keywords that represent textual values or $$ in front of named keywords that represent numeric values. When you use this query in the frontend, you can can dinamically fill the parameters. Examples

Searching for items with qty greater than $$minQty:

{
"qty": {
"$gt": $$minQty
}
}

Updating an item and setting its name to $name:

{
"$set": {
"name": $name
}
}

Inserting an item with values $name and $$qty:

{
"name": $name,
"qty": $$qty
}