You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
160 lines
4.1 KiB
160 lines
4.1 KiB
/*
|
|
Copyright 2020 The Qmgo Authors.
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package operator
|
|
|
|
// Aggregation Pipeline Operators
|
|
// refer: https://docs.mongodb.com/manual/reference/operator/aggregation/
|
|
const (
|
|
// Arithmetic Expression Operators
|
|
Abs = "$abs"
|
|
Add = "$add"
|
|
Ceil = "$ceil"
|
|
Divide = "$divide"
|
|
Exp = "$exp"
|
|
Floor = "$floor"
|
|
Ln = "$ln"
|
|
Log = "$log"
|
|
Log10 = "$log10"
|
|
Multiply = "$multiply"
|
|
Pow = "$pow"
|
|
Round = "$round"
|
|
Sqrt = "$sqrt"
|
|
Subtract = "$subtract"
|
|
Trunc = "$trunc"
|
|
|
|
// Array Expression Operators
|
|
ArrayElemAt = "$arrayElemAt"
|
|
ArrayToObject = "$arrayToObject"
|
|
ConcatArrays = "$concatArrays"
|
|
Filter = "$filter"
|
|
IndexOfArray = "$indexOfArray"
|
|
IsArray = "$isArray"
|
|
Map = "$map"
|
|
ObjectToArray = "$objectToArray"
|
|
Range = "$range"
|
|
Reduce = "$reduce"
|
|
ReverseArray = "$reverseArray"
|
|
Zip = "$zip"
|
|
|
|
// Comparison Expression Operators
|
|
Cmp = "$cmp"
|
|
|
|
// Conditional Expression Operators
|
|
Cond = "$cond"
|
|
IfNull = "$ifNull"
|
|
Switch = "$switch"
|
|
|
|
// Custom Aggregation Expression Operators
|
|
Accumulator = "$accumulator"
|
|
Function = "$function"
|
|
|
|
// Data Size Operators
|
|
BinarySize = "$binarySize"
|
|
BsonSize = "$bsonSize"
|
|
|
|
// Date Expression Operators
|
|
DateFromParts = "$dateFromParts"
|
|
DateFromString = "$dateFromString"
|
|
DateToParts = "$dateToParts"
|
|
DateToString = "$dateToString"
|
|
DayOfMonth = "$dayOfMonth"
|
|
DayOfWeek = "$dayOfWeek"
|
|
DayOfYear = "$dayOfYear"
|
|
Hour = "$hour"
|
|
IsoDayOfWeek = "$isoDayOfWeek"
|
|
IsoWeek = "$isoWeek"
|
|
IsoWeekYear = "$isoWeekYear"
|
|
Millisecond = "$millisecond"
|
|
Minute = "$minute"
|
|
Month = "$month"
|
|
Second = "$second"
|
|
ToDate = "$toDate"
|
|
Week = "$week"
|
|
Year = "$year"
|
|
|
|
// Literal Expression Operator
|
|
Literal = "$literal"
|
|
|
|
// Object Expression Operators
|
|
MergeObjects = "$mergeObjects"
|
|
|
|
// Set Expression Operators
|
|
AllElementsTrue = "$allElementsTrue"
|
|
AnyElementTrue = "$anyElementTrue"
|
|
SetDifference = "$setDifference"
|
|
SetEquals = "$setEquals"
|
|
SetIntersection = "$setIntersection"
|
|
SetIsSubset = "$setIsSubset"
|
|
SetUnion = "$setUnion"
|
|
|
|
// String Expression Operators
|
|
Concat = "$concat"
|
|
IndexOfBytes = "$indexOfBytes"
|
|
IndexOfCP = "$indexOfCP"
|
|
Ltrim = "$ltrim"
|
|
RegexFind = "$regexFind"
|
|
RegexFindAll = "$regexFindAll"
|
|
RegexMatch = "$regexMatch"
|
|
Rtrim = "$rtrim"
|
|
Split = "$split"
|
|
StrLenBytes = "$strLenBytes"
|
|
StrLenCP = "$strLenCP"
|
|
Strcasecmp = "$strcasecmp"
|
|
Substr = "$substr"
|
|
SubstrBytes = "$substrBytes"
|
|
SubstrCP = "$substrCP"
|
|
ToLower = "$toLower"
|
|
ToString = "$toString"
|
|
Trim = "$trim"
|
|
ToUpper = "$toUpper"
|
|
ReplaceOne = "$replaceOne"
|
|
ReplaceAll = "$replaceAll"
|
|
|
|
// Trigonometry Expression Operators
|
|
Sin = "$sin"
|
|
Cos = "$cos"
|
|
Tan = "$tan"
|
|
Asin = "$asin"
|
|
Acos = "$acos"
|
|
Atan = "$atan"
|
|
Atan2 = "$atan2"
|
|
Asinh = "$asinh"
|
|
Acosh = "$acosh"
|
|
Atanh = "$atanh"
|
|
DegreesToRadians = "$degreesToRadians"
|
|
RadiansToDegrees = "$radiansToDegrees"
|
|
|
|
// Type Expression Operators
|
|
Convert = "$convert"
|
|
ToBool = "$toBool"
|
|
ToDecimal = "$toDecimal"
|
|
ToDouble = "$toDouble"
|
|
ToInt = "$toInt"
|
|
ToLong = "$toLong"
|
|
ToObjectID = "$toObjectId"
|
|
IsNumber = "$isNumber"
|
|
|
|
// Accumulators ($group)
|
|
Avg = "$avg"
|
|
First = "$first"
|
|
Last = "$last"
|
|
|
|
StdDevPop = "$stdDevPop"
|
|
StdDevSamp = "$stdDevSamp"
|
|
Sum = "$sum"
|
|
|
|
// Variable Expression Operators
|
|
Let = "$let"
|
|
)
|