Skip to content

Commit

Permalink
More updates after self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-dew committed Jul 28, 2022
1 parent 54ba77f commit eb0a09f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions modules/n1ql/pages/n1ql-language-reference/collectionops.adoc
Expand Up @@ -6,7 +6,7 @@
:keywords: range condition, quantified expression

{description}
The operators include <<range-cond>>, <<range-xform>>, and <<membership-and-existence>>.
The operators include <<range-cond>>, <<range-xform>>, and <<membership-and-existence-tests>>.

NOTE: Although collection operators can be used with any array, they are particularly useful when used to evaluate expressions over an array of objects.
The term _collection_ is used here in a generic sense to refer to any array of objects, rather than in the specific sense of a xref:learn:data/scopes-and-collections.adoc[Couchbase collection].
Expand Down Expand Up @@ -41,7 +41,7 @@ image::n1ql-language-reference/range.png["Syntax diagram", align=left]
[discrete]
==== Arguments

name-var:: An xref:n1ql-language-reference/identifiers.adoc[identifier] that represents the position of a single element in an array, counting from 0.
name-var:: [Optional] An xref:n1ql-language-reference/identifiers.adoc[identifier] that represents the position of a single element in an array, counting from 0.

var:: An xref:n1ql-language-reference/identifiers.adoc[identifier] that represents a single element in an array.

Expand Down Expand Up @@ -315,13 +315,13 @@ image::n1ql-language-reference/range.png["Syntax diagram", align=left]
[discrete]
==== Arguments

name-expr:: [Objects only] An xref:n1ql-language-reference/index.adoc#N1QL_Expressions[expression] that resolves to a string, to use as the name of an attribute in the output.
name-expr:: [`OBJECT` only] An xref:n1ql-language-reference/index.adoc#N1QL_Expressions[expression] that resolves to a string, to use as the name of an attribute in the output.
This expression may make use of the `var` and `name-var` identifiers as required.

var-expr:: An xref:n1ql-language-reference/index.adoc#N1QL_Expressions[expression] that returns a value to include in the output.
This expression may make use of the `var` and `name-var` identifiers as required.

name-var:: An xref:n1ql-language-reference/identifiers.adoc[identifier] that represents the position of a single element in an array, counting from 0.
name-var:: [Optional] An xref:n1ql-language-reference/identifiers.adoc[identifier] that represents the position of a single element in an array, counting from 0.

var:: An xref:n1ql-language-reference/identifiers.adoc[identifier] that represents a single element in an array.

Expand Down Expand Up @@ -540,6 +540,7 @@ The value of each attribute in the output object is the output of the `var-expr`

The name of each attribute in the output object is specified by the `name-expr` argument.
This argument must be an expression that generates a unique name string for every value in the output object.
If the expression does not generate a string, then the current attribute is not output.
If the expression does not generate a unique name string for each value, then only the last attribute is output; all previous attributes are suppressed.

The `name-expr` argument may reference the `var` argument or the `name-var` argument, or use any other expression that generates a unique value.
Expand Down Expand Up @@ -650,7 +651,7 @@ Notice that the position of each element in the input array is calculated _befor
Refer to <<ArrayEx0b>> for another example with position variables.
====

[[membership-and-existence,Membership and Existence Tests]]
[[membership-and-existence-tests,Membership and Existence Tests]]
== Membership and Existence

Membership tests (<<collection-op-in>> and <<collection-op-within>>) enable you to test whether a value exists within an array.
Expand Down

0 comments on commit eb0a09f

Please sign in to comment.