2

Oracle ORDS 使用“转义我的 GeoJSON”时遇到问题

{
"id": 1,
"city": "New York",
"state_abrv": "NY",
"location": "{\"type\":\"Point\",\"coordinates\":[-73.943849, 40.6698]}"
}

在 Oracle DB 中正确说明:

{"type":"Point","coordinates":[-73.943849, 40.6698]}

需要帮助来弄清楚为什么要添加“以及如何防止这种情况发生

4

1 回答 1

3

将此列别名添加到 JSON 列的 restful 服务处理程序查询

SELECT id,
       jsons "{}jsons" --this one
  FROM table_with_json

然后当 ords 看到该列的数据时,它不会将其格式化为 JSON,因为它已经是 json

您可以使用任何您想要的,在您的情况下它可能应该是“{}location”

在此处输入图像描述

于 2020-03-26T14:40:35.293 回答