From d74a43fd7430ab2cadfc9399ab059d64370d06a6 Mon Sep 17 00:00:00 2001 From: Daniel Howe Date: Mon, 20 Nov 2023 00:08:22 +0800 Subject: [PATCH] Update gates.md --- docs/gates.md | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/docs/gates.md b/docs/gates.md index 774a891..00c025f 100644 --- a/docs/gates.md +++ b/docs/gates.md @@ -1,3 +1,33 @@ +### Comparison + +The following operators can be used in queries to compare values: + + $eq: Values are equal + $ne: Values are not equal + $gt: Value is greater than another value + $gte: Value is greater than or equal to another value + $lt: Value is less than another value + $lte: Value is less than or equal to another value + $in: Value is matched within an array + +### Logical + +The following operators can logically compare multiple queries. + + $and: Returns documents where both queries match + $or: Returns documents where either query matches + $nor: Returns documents where both queries fail to match + $not: Returns documents where the query does not match + +### valuation + +The following operators assist in evaluating documents. + + $regex: Allows the use of regular expressions when evaluating field values + $text: Performs a text search + $where: Uses a JavaScript expression to match documents + + @@ -8,37 +38,32 @@ - + - + - + - + - + - - - - - - +
Operator
$gt  greater than @{class:{$gt:'T'}@{ $symbol: { $gt: 3 }
$gte  greater than equals@{class:{$gt:'T'}@{ $symbol: { $gte: 3}
$lt  lesser than @{class:{$lt:'T'}@{ $symbol: { $lt: 4}
$lte lesser than equals@{class:{$lte:'T'}@{ $symbol: { $lte: 4}
$exists does an attribute exist or not@{class:{$gt:'T'}@{ $symbol: { $exists: 'T'}
$regex Matching pattern in pearl-style@{name:{$regex:'^USS\\sE'}})
$type search by type of an element@{name : {$type:4}})@{ $name:{ $regex: '^USS\\sE'}})