All Products
Search
Document Center

:kvpairs_value

Last Updated:Sep 09, 2021

Feature functions

You can use feature functions in sort expressions. Most feature functions can be used only in fine sort expressions. You can combine various syntax and clauses to perform complex sorts.

kvpairs_value: returns the value of the specified field in a kvpairs clause in a query

1.Syntax:

kvpairs_value(query_key, type)

2.Parameters:

  • query_key: the name of the field specified in the kvpairs clause.

  • type: the data type of the query_key field value in the kvpairs clause. The following data types are supported: INT, FLOAT, and DOUBLE.

3.Scenarios:

Scenario 1:

The kvpairs clause of a query contains the following information: query_key:10. The value of the query_key field is of the INT type. You want to obtain value of the query_key field. In this case, use the following expression: kvpairs_value(query_key, INT)

Scenario 2:

The kvpairs clause of a query contains the following information: query_key:10.1. The value of the query_key field is of the FLOAT type. You want to obtain the value of the query_key field. In this case, use the following expression: kvpairs_value(query_key, FLOAT).

Scenario 3:

The kvpairs clause of a query contains the following information: query_key:10.12. The value of the query_key field is of the DOUBLE type. You want to obtain the value of the query_key field. In this case, use the following expression: kvpairs_value(query_key, DOUBLE).