vania-janet/multiturn-rag-retrieval-data huggingface dataset:
,0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0]]},{"name":"QId_d1","samples":0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0]
For a generic starter and demo notebook for IBM Cloud® Data Engine that you can use as basis for your work, see [Using IBM Cloud SQL Query](https://dataplatform.cloud.ibm.com/analytics/notebooks/v2/656c7d43-7ccd-4e50-a3c0-bbc37c001132/view?access_token=baaa77ad715e17a8f823615d45431329fde0fe92fecb85abb9fc55a877939fe8).

Important: Replace these variables in the following steps:



* bucket - The bucket where your flow logs are stored.
* region - The [region alias](https://cloud.ibm.com/docs/sql-queryendpoints) of the bucket that holds your flow logs.



To analyze flow logs, follow these steps:



1. Define a table for flow logs:

-- Table definition for flow logs
CREATE TABLE FLOW(
version string,
collector_crn string,
attached_endpoint_type string,
network_interface_id string,
instance_crn string,
capture_start_time timestamp,
capture_end_time timestamp,
number_of_flow_logs int,
flow_logs array<struct<
start_time: string,
end_time: string,
connection_start_time: string,
direction: string,
action: string,
initiator_ip: string,
target_ip: string,
initiator_port: int,
target_port: int,
transport_protocol: int,
ether_type: string,
was_initiated: boolean,
was_termined: boolean,
bytes_from_initiator: long,
packets_from_initiator: long,
bytes_from_target: long,
packets_from_target: long,
cumulative_bytes_from_initiator: long,
cumulative_packets_from_initiator: long,
Continue with the preceding example that specifies PARTITION BY (customerid) INTO 10 OBJECTS stores the query result into 10 objects, which ensures that all data for a customer is stored in the same partition. Although it is ensured that all data for a certain customer is stored in the same partition, it is not ensured that the data is physically sorted according to the specified column.





 Partition by number of rows 

By partitioning by number of rows you can specify the number of rows that go into a single partition. To specify the number of rows stored in each partition, use the EVERY x ROWS clause. In case the row length of the result object is not varying heavily, with the partition every rows clause you can also create almost equally sized result partitions.

The use of the PARTITIONED EVERY x ROWS clause on a sorted query result ensures that partitions are created to have some rows that are sorted according to the query's SORT BY clause. This physical layout can be useful to create partitions that are processed by an application in a pagination manner, for example, browsing order data sorted by order date and customer ID.

The use of PARTITIONED EVERY x ROWS clause causes data to be written single-threaded to Cloud Object Storage, which means that no parallel I/O is performed to write query results to Cloud Object Storage.







 dbResultClause 

You can use the Db result clause to specify that you want query results to be stored as a relational database table in IBM Cloud. Currently, IBM® Db2® on Cloud is the only supported target database.

Storing query results in a database creates a new table with the columns that are determined by the query result. When you write to Db2, the following type-mapping rules apply.



* String types are mapped to VARCHAR(32000) columns.
* Struct types are not mapped and must be flattened first. See the FLATTEN[table transformation function](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-referencetableTransformer).
* Arrays, time series, and spatial data types are not mapped and must be converted with appropriate SQL functions.



The table name and optional schema are specified as part of the target URI.
,0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0]]},{"name":"QId_d26","samples":0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0]
To use timeslice, the time fields in your documents must be of the date data type and in [UNIX time](http://en.wikipedia.org/wiki/Unix_time) format. Unless both of these requirements are met, the timeslice parameter does not work correctly. You can create a timeslice if your documents contain date fields with values such as 1496228512. The value must be in a numeric format (for example, float or double) and not enclosed in quotation marks. The service treats dates in text and dates in ISO 8601 format as data type string, not as data type date. This example returns values for "sales" ("product.sales") at intervals of 2 days in the New York City time zone.

For example:

timeslice(product.sales,2day,America/New York)





 top_hits 

Returns the documents ranked by the score of the query or enrichment. Can be used with any query parameter or aggregation. This example returns the 10 top hits for a term aggregation.

For example:

term(enriched_text.concepts.text).top_hits(10)





 unique_count 

Returns a count of the unique instances of the specified field in the collection.

Examples:

unique_count(enriched_text.keyword.text)

nested(enriched_text.entities).term(enriched_text.entities.text,count:3).unique_count(enriched_text.entities.type)





 max 

Returns the highest value in the specified field across all matching documents.

For example:

max(product.price)





 min 

Returns the lowest value in the specified field across all matching documents.

For example:

min(product.price)





 average 

Returns the mean of values of the specified field across all matching documents.

For example:

average(product.price)





 sum 

Adds together the values of the specified field across all matching documents.

For example:

sum(product.price)
[checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Define custom stop words or query expansions ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Search specific document fields or enrichments ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Use operators, such as boolean clauses in the search ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Enable spelling correction !
],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0]]},{"name":"QId_d12","samples":0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0
,0,0],0,0],0,0],0,0],0,0],0,0]]},{"name":"QId_d21","samples":0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0],0,0]
(3, 42, 50),
(4, 42, -250),
(5, 4711, 1000),
(6, 4711, -300),
(7, 4711, 100),
(8, 42, 200),
(9, 4711, -400) AS txn
WINDOW current_balance AS (
PARTITION BY txn.col2
ORDER BY txn.col1
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) ORDER BY account, txn_id
Show more

The result of the example query is shown in the following table.



Table 29. Query result for example: total balance of each account at the time of each transaction.

 TXN_ID ACCOUNT TXN_AMOUNT BALANCE 

 1 42 100 100 
 3 42 50 150 
 4 42 -250 -100 
 8 42 200 100 
 2 4711 300 300 
 5 4711 1000 1300 
 6 4711 -300 1000 
 7 4711 100 1100 
 9 4711 -400 700 









 More topics - window function 

For more information about the clauses that are used by a window function, see the following topics:



* [expression](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-referenceexpression)
* [identifier](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-referenceidentifier)
* [sortItem](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-referencesortItem)







 Related references - named window clause 

A named window clause is referenced by the following clauses:



* [fullselect](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-referencefullselect)
* [simpleselect](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-referencesimpleselect)
[nested](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregationsnested) Restrict aggregation nested(enriched_text.entities) 
 [sum](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregationssum) Sum of all fields in the results set. sum(product.price) 
 [term](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregationsterm) Count of identical values term(enriched_text.concepts.text,count:10) 
 [timeslice](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregationstimeslice) Time-based distribution timeslice(last_modified,2day,America/New York) 
 [top_hits](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregationstop_hits) Top-ranked result documents for the current aggregation term(enriched_text.concepts.text).top_hits(10) 
 [unique_count](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-query-aggregationsunique_count) Count of unique values for a field within an aggregation unique_count(enriched_text.entities.type)
Increasing memory decreases the amount that MongoDB reads or writes to disk, so additional memory might alleviate pressure on disk I/O by supporting more caching.

More information about the WiredTiger cache is in the [MongoDB documentation](https://docs.mongodb.com/manual/faq/storage/to-what-size-should-i-set-the-wiredtiger-internal-cache).





 Query Performance 

The MongoDB documentation has multiple resources on query performance, including a how-to on [analyzing query performance](https://docs.mongodb.com/manual/tutorial/analyze-query-plan/). Once you have a general idea on how your queries perform, they also have tips on [optimizing your queries](https://docs.mongodb.com/manual/core/query-optimization/).

As a more advanced topic, you can learn how MongoDB [manages query plans](https://docs.mongodb.com/manual/core/query-plans/).





 Other MongoDB Monitoring Tools 

You can also take advantage of some of the native MongoDB monitoring functions. For example, you can use both [mongotop](https://docs.mongodb.com/manual/reference/program/mongotop/bin.mongotop) and [mongostat](https://docs.mongodb.com/manual/reference/program/mongostat/bin.mongostat).

mongotop 30 --username admin --password $PASSWORD --ssl --sslCAFile $CERTFILE --authenticationDatabase admin --host host1.databases.appdomain.cloud:31712, host2.databases.appdomain.cloud:31712

mongostat -n 20 1 --username admin --password $PASSWORD --ssl --sslCAFile $CERTFILE --authenticationDatabase admin --host host1.databases.appdomain.cloud:31712,host2.databases.appdomain.cloud:31712 --json
[checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Configure continuous relevancy training ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Retrieve tables ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Query result deduplication ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Identify document similarity in query results ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Indicate a preference (bias) in queries !
[checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Use operators, such as boolean clauses in the search ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Enable spelling correction ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Add curations to return hardcoded answers to certain questions ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Use relevancy training ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Enable answer finding to return a succinct answer from a passage ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Use table retrieval !
[checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Retrieve passages from documents ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Perform relevancy training to improve query results ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Configure continuous relevancy training ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Retrieve tables !
[count](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameterscount) The number of result documents to return. count=15 
 [offset](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parametersoffset) The number of results to ignore before returning result documents from the results set offset=100 
 [return](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parametersreturn) List of fields to return return=title,url 
 [sort](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameterssort) Field to sort results set by sort=enriched_text.sentiment.document.score 
 [bias](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parametersbias) Field to bias results set by bias=publication_date 
 [passages.fields](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameterspassages_fields) Fields to extract passages from passages=true&passages.fields=text,abstract,conclusion 
 [passages.count](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameterspassages_count) Number of passages to return passages=true&passages.count=6 
 [passages.characters](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameterspassages_characters) Length of passages passages=true&passages.characters=144 
 [highlight](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parametershighlight) Highlight query matches highlight=true 
 [deduplicate](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parametersdeduplicate) Deduplicate IBM Watson™ Discovery News returned results deduplicate=true
Using deduplication removes most duplicate articles from your search queries.Discovery deduplicates by using approximate matching on the title field and therefore a field doesn't need to be specified.To apply deduplication, use the following parameter in your query. This query automatically deduplicates on the title field in IBM Watson™ Discovery News. &deduplicate=true
If you prefer to deduplicate on a field other than title, use the following syntax in your query. Replace {field} with the name of the field you wish to deduplicate on. The specified {field} must be a string. &deduplicate.field={field}
<-- </section "id="section-deduplicatewds" "> --><-- </section "id="section-deduplication" "> --><-- </section "id="section-deduplicate" "> --><-- <section "id="section-collection_ids" "> --> collection_ids A comma-separated list of collections in the same environment to be queried. This parameter is only valid when using the environments/{environment_id}/query? method. See Querying multiple collections]] ! ! for more information. &collection_ids={id1},{id2}
<-- </section "id="section-collection_ids" "> --><-- <section "id="section-similar" "> --> similar Document similarity identifies documents that are similar to the documents listed in the similar.document_ids parameters, which can be further refined by specifing which fields to consider for comparison, using the similar.fields parameters. The default is false. See Document similarity]] ! ! ! ! ! ! ! !
curl -s -X POST -H "Content-Type: application/json" --data '{ "query": "query read_database { read_database { id balance transactiontime } }" }' http://$INSTANCE_IP/api/bank
5. Issue the following curl command to query the COS bucket. The application running on the instance will read content from the Object Storage and return the results in JSON format. The data stored in COS is only available to the application running from the instance on the dedicated host.

curl -s -X POST -H "Content-Type: application/json" --data '{ "query": "query read_items { read_items { key size modified } }" }' http://$INSTANCE_IP/api/bank
6. Issue the following curl command to query the database and COS bucket at once. The application running on the instance will read content from the Databases for PostgreSQL and Object Storage and return the results in JSON format.

curl -s -X POST -H "Content-Type: application/json" --data '{ "query": "query read_database_and_items { read_database { id balance transactiontime } read_items { key size modified } }" }' http://$INSTANCE_IP/api/bank







 Step 5: Resize the VSI and expand the attached block storage volume on the dedicated host 

If you have observed the profile of the instance provisioned on the dedicated host, it is set to cx2-2x4 where c stands for Compute family (category) with 2 vCPUs and 4 GiB RAM. In this section, you will resize the instance by updating the profile to cx2-8x16 with 8 vCPUs, 16 GiB RAM.

In this section, you will also expand the block storage volume attached to the VSI from 100 GB to 250 GB. To understand the maximum capacity on the selected volume profile, check [expanding block storage volume capacity](https://cloud.ibm.com/docs/vpc?topic=vpc-expanding-block-storage-volumes&interface=ui)



 Resize the VSI 



1.
[checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Configure dictionary tokenization ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Advanced question-answering capabilities, such as returning the exact answer ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Discovery Query Language (DQL) API support ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) 
 Retrieve passages from documents ![checkmark icon](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/icons/checkmark-icon.svg) !
Start querying flow logs from the bucket that you specified when [Creating a flow log collector](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-flow-log-collector).

To view the most frequent flow object, run the following query:

SELECT * FROM cos://<region>/<bucket>/ibm_vpc_flowlogs_v1/ STORED AS JSON ORDER BY stream-id LIMIT 1 INTO cos://<region>/<target_bucket>/result/ STORED AS JSON

Where:



* bucket - The bucket where your flow logs are stored.
* region - The [region alias](https://cloud.ibm.com/docs/sql-queryendpoints) of the bucket that holds your flow logs.
* target_bucket - A bucket that is different from the bucket where your flow logs are stored. It is recommended to use the target location that was created by IBM Cloud® Data Engine.

You can find the Target location listed under the query editor field in the IBM SQL Query UI.



4. Use the preview to inspect the content of the object.
5. Refine your query to analyze specific aspects of your flow logs by using [SQL](https://cloud.ibm.com/docs/sql-query?topic=sql-query-sql-reference).



Flow logs are periodically written to IBM Cloud® Object Storage about every 5 minutes. Flow logs are published more frequently in cases where the flow log collector reaches 100 KB flows.



 Flow log data format 

Flow log traffic summaries contain the following information:



* Byte/packet counts, separately for RX (receive) and TX (transmit).
* Whether a connection starts or stops in the time window.



Because a flow log reflects network traffic in a limited window of time, a long-running connection might cause multiple flow logs to be emitted. For every connection processed by a vNIC, a time-ordered sequence of flow logs emits (not including failures). These flow logs appear in one or more Object Storage objects.
"$lte": 1900
}
},
"sort": [
"year:number",
"title:string"
],
"fields": [
"year",
"title"
]
}

See the following example that uses the $lte operator with a database that is indexed on the field year:

{
"selector": {
"year": {
"$lte": 1900
}
},
"sort": [
"year"
],
"fields": [
"year"
]
}





 The $eq operator 

The $eq operator matches if the specified field content is equal to the supplied argument.

See the following example that uses the $eq operator with full-text indexing:

{
"selector": {
"year": {
"$eq": 2001
}
},
"sort": [
"title:string"
],
"fields": [
"title"
]
}

See the following example that uses the $eq operator with a database that is indexed on the field year:

{
"selector": {
"year": {
"$eq": 2001
}
},
"sort": [
"year"
],
"fields": [
"year"
]
}





 The $ne operator 

The $ne operator matches if the specified field content isn't equal to the supplied argument.

The $ne operator can't be the basic (lowest level) element in a selector when you use an index of type json.

See the following example that uses the $ne operator with full-text indexing:

{
"selector": {
"year": {
"$ne": 1892
}
},
"fields": [
"year"
],
"sort": [
"year:number"
]
}