This chapter introduces how to query data with scalar filtering.
curl -u shiva:shiva -XGET 'localhost:8902/hippo/v1/{table}/_query?pretty' -H 'Content-Type: application/json' -d'{
"output_fields": ["book_id", "book_intro"],
"expr" : "word_count >= 11000",
"limit" : 2,
"only_explain" : false
}';
Result:
{
"fields_data" : [
{
"field_name" : "book_id",
"field_values" : [11,12]
},
{
"field_name" : "book_intro",
"field_values" : [[11.0,1.0],[12.0,1.0]]
}
]
}
Parameter description:
Parameters | Description | Required |
---|---|---|
table | Table name, such as "book" created in this example | Yes |
limit | The number of results to return | Yes |
database_name | Database where the table is located | No, defaults to "default" database |
output_fields | Name of the field to return | No |
expr | Filter condition | No |
only_explain | Whether to execute "explain" only | No, defaults to false |