Range Match
The range
query allow you to filter documents based on a specified range of values within a given field. It can be used for numeric and date fields. The Range query uses the following terms:
"gte": the document must be greater than or equals to the provided values
"gt": the document must be greater than the provided values
"lte": the document must be smaller than or equals to the provided values
"lt": the document must be smaller than the provided values
Example 1:
The above example requires candidates to have a field named "date" with values that are greater than or equal to "2023-01-01" and smaller than or equal to "2023-12-31".
Example 2:
The above example requires candidates to have a field named "datetime" with values that are greater than or equal to "2023-01-01T08:00:00" and smaller than "2023-01-01T17:30:00"".
Example 3:
The above example requires candidates to have a field named "price" with values that are greater than "10" and smaller or equal to than "30"".
Last updated