删除地图类型的aerospike db记录中的bin值
假设aerospike数据库记录了如下数据: 姓名年龄特征删除地图类型的aerospike db记录中的bin值,aerospike,aql,Aerospike,Aql,假设aerospike数据库记录了如下数据: 姓名年龄特征 sachin 25地图(“{”重量:70,“高度:25}”) 我想通过aql从地图记录中删除“高度”:25。我该怎么做呢?我只是想说明AQL是一种CLI,而不是一种查询语言。它是在C客户机上构建的,因此最终这些命令被转换为C客户机的常规调用。如果您正在开发应用程序,您应该使用C、Java、C#、Go、Python、Node.js等的客户机 aql> insert into test.demo (pk, name, age) val
sachin 25地图(“{”重量:70,“高度:25}”)
我想通过aql从地图记录中删除“高度”:25。我该怎么做呢?我只是想说明AQL是一种CLI,而不是一种查询语言。它是在C客户机上构建的,因此最终这些命令被转换为C客户机的常规调用。如果您正在开发应用程序,您应该使用C、Java、C#、Go、Python、Node.js等的客户机
aql> insert into test.demo (pk, name, age) values ("s", "sachin", 25)
aql> operate map_put(props, "height", 25) on test.demo where pk="s"
aql> operate map_put(props, "weight", 70) on test.demo where pk="s"
aql> set output json
OUTPUT = JSON
aql> select * from test.demo where pk="s"
[
[
{
"name": "sachin",
"age": 25,
"props": {
"height": 25,
"weight": 70
}
}
],
[
{
"Status": 0
}
]
]
aql> operate map_remove_by_key(props, "height") on test.demo where pk="s"
[
[
{
"props": [
"height",
25
]
}
],
[
{
"Status": 0
}
]
]
aql> select * from test.demo where pk="s"
[
[
{
"name": "sachin",
"age": 25,
"props": {
"weight": 70
}
}
],
[
{
"Status": 0
}
]
]