Riak数据类型:“_ <type-name>”后缀是否必要?</type-name>

时间:2015-03-21 19:13:28

标签: riak

我使用Riak map数据类型将用户信息存储在users存储桶中。通过简单的curl调用对此进行测试时,我发现有必要将_register附加到每个属性名称,以便接受curl请求。

例如,这失败了:

curl -XPOST http://127.0.0.1:10018/types/user/buckets/users/datatypes/jsmith \
  -H "Content-Type: application/json" \
  -d '{"update":{"first-name":"John","last-name":"Smith"}}'

Invalid map field name 'first-name'

但这有效:

curl -XPOST http://127.0.0.1:10018/types/user/buckets/users/datatypes/jsmith \
  -H "Content-Type: application/json" \
  -d '{"update":{"first-name_register":"John","last-name_register":"Smith"}}'

我真的需要将_<type-name>附加到每个属性吗?

1 个答案:

答案 0 :(得分:0)

数据类型地图的示例显示地图后缀必须包含type Basho - Riak Data-types Maps