You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To filter nodes by a string property using the K-neighbor API, you should ensure that the predicate is correctly formatted in the JSON request. The correct syntax for using predicates like P.eq is to use a string representation in the format "P.method(value)". However, it seems there might be an issue with how the value is being interpreted in your JSON.
Make sure that the entire predicate, including the method and the value, is enclosed in double quotes. If you are still encountering errors, ensure that the JSON is correctly formatted and that the Content-Type is set to application/json in your request header to avoid any HTTP 415 Unsupported Media Type errors [1].
imbajin
changed the title
K-neighbor API (POST, Advanced Version) 如何根据节点字符串类型属性筛选节点
[Question] How to filter str in vertex in K-neighbor API (POST Version)
Nov 13, 2024
imbajin
changed the title
[Question] How to filter str in vertex in K-neighbor API (POST Version)
[Question] How to filter str with vertex in K-neighbor API (POST Version)
Nov 13, 2024
Feature Description (功能描述)
如何根据节点字符串类型属性筛选节点,例如city属性为Hongkong
请求内容设置如下后
"label": "person",
"properties": {
"city": "P.eq('Hongkong')"
}
报错:
{
"exception": "class org.apache.hugegraph.HugeException",
"message": "Invalid value ''Hongkong'', expect a number",
"cause": "org.apache.hugegraph.HugeException: Can't read json: Unexpected character (''' (code 39)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n at [Source: (String)"'Hongkong'"; line: 1, column: 2]"
}
此外尝试了"city": "P.eq("Hongkong")" 还有 "city": "P.eq(Hongkong)",均无法筛选节点并报错
The text was updated successfully, but these errors were encountered: