我使用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>
附加到每个属性吗?