1 // Licensed under the Apache License, Version 2.0 (the "License"); you may not 2 // use this file except in compliance with the License. You may obtain a copy of 3 // the License at 4 // 5 // http://www.apache.org/licenses/LICENSE-2.0 6 // 7 // Unless required by applicable law or agreed to in writing, software 8 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 // License for the specific language governing permissions and limitations under 11 // the License. 12 13 package mango 14 15 // Operator represents a Mango [operator]. 16 // 17 // [operator]: https://docs.couchdb.org/en/stable/api/database/find.html#explicit-operators 18 type Operator string 19 20 // [Combination Operators] 21 // 22 // [Combination Operators]: https://docs.couchdb.org/en/stable/api/database/find.html#combination-operators 23 const ( 24 OpAnd = Operator("$and") 25 OpOr = Operator("$or") 26 OpNot = Operator("$not") 27 OpNor = Operator("$nor") 28 OpAllMatch = Operator("$allMatch") 29 OpKeyMapMatch = Operator("$keyMapMatch") 30 ) 31 32 // [Condition Operators] 33 // 34 // [Condition Operators]: https://docs.couchdb.org/en/stable/api/database/find.html#condition-operators 35 const ( 36 OpLessThan = Operator("$lt") 37 OpLessThanOrEqual = Operator("$lte") 38 OpEqual = Operator("$eq") 39 OpNotEqual = Operator("$ne") 40 OpGreaterThan = Operator("$gt") 41 OpGreaterThanOrEqual = Operator("$gte") 42 OpExists = Operator("$exists") 43 OpType = Operator("$type") 44 OpIn = Operator("$in") 45 OpNotIn = Operator("$nin") 46 OpSize = Operator("$size") 47 OpMod = Operator("$mod") 48 OpRegex = Operator("$regex") 49 OpAll = Operator("$all") 50 OpElemMatch = Operator("$elemMatch") 51 ) 52