diff --git a/docs/querying/rql/what-is-rql.mdx b/docs/querying/rql/what-is-rql.mdx index 3f17935a34..392c5d9a68 100644 --- a/docs/querying/rql/what-is-rql.mdx +++ b/docs/querying/rql/what-is-rql.mdx @@ -358,9 +358,11 @@ where Lines[].ProductName in ("Chang", "Spegesild", "Unknown product name") --- -**To negate an `in` condition**, use the `NOT` operator. In RQL, `NOT` cannot start a `where` clause; it must follow a **valid preceding expression.** +**To negate an `in` condition**, use the `NOT` operator. +In RQL, `NOT` cannot start a `where` clause; it must follow a **valid preceding expression.** -To ensure accuracy, especially when fields might be missing from some documents, use `exists(fieldName)` as the anchor: +To ensure accuracy, especially when fields might be missing from some documents, +use `exists(fieldName)` as the anchor: ```csharp @@ -369,8 +371,9 @@ where exists(Name) and NOT Name in ("The Big Cheese", "The Cracker Box") ``` -**Note:** Avoid using `where true` or an `exists()` check on a *different* field. If a document is missing the field you're -filtering on, these anchors may return unexpected results. +**Note:** +Avoid using `where true` or an `exists()` check on a *different* field. +If a document is missing the field you're filtering on, these anchors may return unexpected results. diff --git a/versioned_docs/version-6.2/client-api/session/querying/what-is-rql.mdx b/versioned_docs/version-6.2/client-api/session/querying/what-is-rql.mdx index 3d63d23c2b..ce6f2132b7 100644 --- a/versioned_docs/version-6.2/client-api/session/querying/what-is-rql.mdx +++ b/versioned_docs/version-6.2/client-api/session/querying/what-is-rql.mdx @@ -347,12 +347,13 @@ where PricePerUnit >= 10.5 and PricePerUnit <= 13.0 // Using >= and <= + #### Operator:    `in` -The operator `in` is validating if a given field contains passed values. -It will return results if a given field matches **any** of the passed values. +The `in` operator evaluates a field against a list of values. +It will return results if the field matches **any** of the items in that list. @@ -369,8 +370,28 @@ where Lines[].ProductName in ("Chang", "Spegesild", "Unknown product name") `} + +--- + +**To negate an `in` condition**, use the `NOT` operator. +In RQL, `NOT` cannot start a `where` clause; it must follow a **valid preceding expression.** + +To ensure accuracy, especially when fields might be missing from some documents, +use `exists(fieldName)` as the anchor: + + +```csharp +from "Companies" +where exists(Name) and NOT Name in ("The Big Cheese", "The Cracker Box") +``` + + +**Note:** +Avoid using `where true` or an `exists()` check on a *different* field. +If a document is missing the field you're filtering on, these anchors may return unexpected results. + #### Operator:    `all in` diff --git a/versioned_docs/version-7.0/client-api/session/querying/what-is-rql.mdx b/versioned_docs/version-7.0/client-api/session/querying/what-is-rql.mdx index 5fa4670386..3be6415209 100644 --- a/versioned_docs/version-7.0/client-api/session/querying/what-is-rql.mdx +++ b/versioned_docs/version-7.0/client-api/session/querying/what-is-rql.mdx @@ -348,12 +348,13 @@ where PricePerUnit >= 10.5 and PricePerUnit <= 13.0 // Using >= and <= + #### Operator:    `in` -The operator `in` is validating if a given field contains passed values. -It will return results if a given field matches **any** of the passed values. +The `in` operator evaluates a field against a list of values. +It will return results if the field matches **any** of the items in that list. @@ -370,8 +371,28 @@ where Lines[].ProductName in ("Chang", "Spegesild", "Unknown product name") `} + +--- + +**To negate an `in` condition**, use the `NOT` operator. +In RQL, `NOT` cannot start a `where` clause; it must follow a **valid preceding expression.** + +To ensure accuracy, especially when fields might be missing from some documents, +use `exists(fieldName)` as the anchor: + + +```csharp +from "Companies" +where exists(Name) and NOT Name in ("The Big Cheese", "The Cracker Box") +``` + + +**Note:** +Avoid using `where true` or an `exists()` check on a *different* field. +If a document is missing the field you're filtering on, these anchors may return unexpected results. + #### Operator:    `all in` diff --git a/versioned_docs/version-7.1/client-api/session/querying/what-is-rql.mdx b/versioned_docs/version-7.1/client-api/session/querying/what-is-rql.mdx index bbe9e3b8a7..0173ab1b68 100644 --- a/versioned_docs/version-7.1/client-api/session/querying/what-is-rql.mdx +++ b/versioned_docs/version-7.1/client-api/session/querying/what-is-rql.mdx @@ -346,14 +346,15 @@ where PricePerUnit >= 10.5 and PricePerUnit <= 13.0 // Using >= and <= `} - + + #### Operator:    `in` -The operator `in` is validating if a given field contains passed values. -It will return results if a given field matches **any** of the passed values. +The `in` operator evaluates a field against a list of values. +It will return results if the field matches **any** of the items in that list. @@ -370,8 +371,28 @@ where Lines[].ProductName in ("Chang", "Spegesild", "Unknown product name") `} + +--- + +**To negate an `in` condition**, use the `NOT` operator. +In RQL, `NOT` cannot start a `where` clause; it must follow a **valid preceding expression.** + +To ensure accuracy, especially when fields might be missing from some documents, +use `exists(fieldName)` as the anchor: + + +```csharp +from "Companies" +where exists(Name) and NOT Name in ("The Big Cheese", "The Cracker Box") +``` + + +**Note:** +Avoid using `where true` or an `exists()` check on a *different* field. +If a document is missing the field you're filtering on, these anchors may return unexpected results. + #### Operator:    `all in`