You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Query.php
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -463,4 +463,40 @@ private function composeSort()
463
463
}
464
464
return$sort;
465
465
}
466
+
467
+
/**
468
+
* Helper method for easy querying on values containing some common operators.
469
+
*
470
+
* The comparison operator is intelligently determined based on the first few characters in the given value and
471
+
* internally translated to a MongoDB operator.
472
+
* In particular, it recognizes the following operators if they appear as the leading characters in the given value:
473
+
* <: the column must be less than the given value ($lt).
474
+
* >: the column must be greater than the given value ($gt).
475
+
* <=: the column must be less than or equal to the given value ($lte).
476
+
* >=: the column must be greater than or equal to the given value ($gte).
477
+
* <>: the column must not be the same as the given value ($ne). Note that when $partialMatch is true, this would mean the value must not be a substring of the column.
478
+
* =: the column must be equal to the given value ($eq).
479
+
* none of the above: use the $defaultOperator
480
+
*
481
+
* Note that when the value is empty, no comparison expression will be added to the search condition.
482
+
*
483
+
* @param string $name column name
484
+
* @param scalar $value column value
485
+
* @param string $defaultOperator Defaults to =, performing an exact match.
486
+
* For example: use 'LIKE' or 'REGEX' for partial cq regex matching
0 commit comments