eq(author,)
or in the usual URL format: author=
. [ { title: " ", year: 1993, series: " " }, { title: " ", year: 1993, series: " " }, { title: " ", year: 1995, series: " " }, { title: " ", year: 1995, series: " " } ]
db.users.find({series: " "})
eq(series, " ")
series=" "
db.users.find({series: " ", year: 1995})
eq(series, " "),eq(year, 1995)
{ title: " ", year: 1995, series: " ", translations: { language: "English", title: "Godsdoom" } }
translations
key is defined here. And to find all the books translated into English, we need to use a dot. db.users.find({"translations.language": "English"})
eq(translations.language, "English")
db.users.find().skip(10).limit(10)
limit(10,10)
db.users.find().sort({title: 1})
sort(+title)
Function | Description |
---|---|
in (<propyrty>, <array-of-values>) | Selects objects whose value is The specified property is included in the specified array of properties. Example: in(name,(Silver,Gold)) |
out (<propyrty>, <array-of-values>) | Selects objects for which the value of the specified property is not included in the specified array of properties. Example: out(name,(Platinum,Gold)) |
limit (<start>, <number>) | Returns the specified number (number) of objects starting from a certain ( start ) position. Example: limit(0,2) |
sort (<list of properties with + or - prefix>) | Sorts the list of objects by specified properties (the number of properties is unlimited). First, the list is sorted by the first of the specified properties, then by the second, and so on. The sort order is determined by the prefix: + - ascending, - - descending. Example: sort(+memory,-diskspace) |
select (<list offf attributes>) | Cuts each object to the set of properties specified in the arguments. Example: select(name,user) |
values ​​(<property>) | Returns a set of values ​​from the specified field of all objects. Example: values(ve.name) |
count () | Returns the number of records. Example: in(name,(Silver,Gold))&count() |
max (<property?>) | Returns the maximum value from the specified field of all objects. Example: max(ve.memory) |
min (<property?>) | Returns the minimum value from the specified field of all objects. Example: min(ve.memory) |
Function | Description |
---|---|
like (<property>, <pattern>) | Searches for a given pattern (pattern) in a given property (property). This the function is similar to the SQL LIKE operator, although it uses the * symbol instead of % . To determine the character * itself in a pattern, it must be percent-coded, that is, you must write %2A instead of * , see examples. In addition, in the pattern, you can use the symbol ? denoting that any character in this position is valid.Examples: like(firstName,Jo*) |
Function | Description |
---|---|
implementing (<bas-type>) | Returns a list of objects (resources and types) that implement the base type and include the base type itself. Example: implementing (http://aps-standard.org/samples/user-mgmt/offer/1.0) |
composing (<derived-type>) | Returns a list of types that are implemented by the derived type, including the derived type itself. Example: composing(http://aps-standard.org/samples/user-mgmt/offer/1.0) |
linkedWith (<resource ID>) | Returns a list of resources that are associated with the resource whose ID is specified as an argument. The APS controller searches for all resource references, including internal system references. For example, the admin / owner / referrer actor with access to the resource will also be considered a “bound” resource. Examples: linkedWith(220aa29a-4ff4-460b-963d-f4a3ba093a0a) |
Operator | Alias | Examples |
---|---|---|
and (<query>, <query>, ...) | & , | and (limit(0,2),like(name,*L*)) Value Selects the first two sentences whose names match the case insensitive pattern *L* |
or (<query>, <query>, ...) | | ; | or(like(description,*free*),in(name,(Silver,Gold))) Value Selects all sentences whose descriptions correspond to the pattern *free* , as well as those whose name is Silver or Gold . |
Operator | Examples |
---|---|
not (<query>) | not(like(name,*free*)) Value Selects all offers, except those whose name matches Habr and HotTimes - RQL pattern *free* . |
and
operator is an implicit top-level RQL operator. For example, the expression http://hosting.com?and(arg1,arg2,arg3)
equivalent to http://hosting.com?arg1,arg2,arg3
.implementing(<typ>),(prop1=eq=1|prop2=ge=2)
.Operator | Alias | Examples |
---|---|---|
eq (<propyrty>, <valu>) | = eq = | eq(aps.status,aps:ready) Value Selects all objects whose aps.status is set to aps:ready . |
ne (<propyrty>, <valu>) | = ne = | ne(aps.status,aps:ready) Value Selects all objects whose aps.status is set to aps:ready . |
gt (<propyrty>, <valu>) | = gt = | implementing (http://aps-standard.org/samples/user-mgmt/offer), hardware.memory = gt = 1024) Value Selects all offers (offers) that provide hardware.memory more than 1024. |
ge (<propyrty>, <valu>>) | = ge = | implementing (http://aps-standard.org/samples/user-mgmt/offer), hardware.memory = ge = 1024) Value Selects all offers (offers) providing hardware.memory greater than or equal to 1024. |
lt (<propyrty>, <valu>) | = lt = | implementing (http://aps-standard.org/samples/user-mgmt/offer), hardware.CPU.number = lt = 16) Value Selects all offers (offers) providing hardware.CPU.number less than 16. |
le (<propyrty>, <valua>) | = le = | implementing (http://aps-standard.org/samples/user-mgmt/offer), hardware.CPU.number = le = 16) Value Selects all offers (offers) providing hardware.CPU.number less than or equal to 16. |
null
, true
, false
or an empty string value. They all apply to certain types of data.Function value | Applicable Types | Descriptions | Examples |
---|---|---|---|
null () | Any type | Set if the value is null | name=eq=null() |
true () false () | Boolean | Set if true or false | disabled=eq=false() |
empty () | String | Set if the string value is empty (not null , but does not contain any characters) | addressPostal.extendedAddress=eq=empty() |
Source: https://habr.com/ru/post/331774/
All Articles