我试图在rethinkdb文档中更新数组中的项目。该文件看起来像这样。
{
"id": "dab7ddcd-29bb-4ff2-afcb-f4bb030f74bd",
"number": 1,
"questions": [
{
"question": "Meneer ik snap iets niet",
"questiondid": "839d5e49-5b50-4c61-960e-d7e1431949ef",
"upvotes": 0,
"userid": 111523
},
{
"question": "Meneer ik snap iets niet",
"questiondid": "1ea57f05-f637-4758-b341-c5272538f80c",
"upvotes": 0,
"userid": 111523
}
],
"sha": "1234567890jareau",
"title": "Test question"
}
在这个例子中,我试图改变' upvotes'在问题中为1:" 1ea57f05-f637-4758-b341-c5272538f80c"。如何在不知道数组中对象的索引是什么的情况下动态地执行此操作?
提前致谢
答案 0 :(得分:0)
这样的事情:
{
"content_available":true,
"to":"fd4...23f7",
"priority":"high",
"notification":
{
"body":"anything",
"title":"any title"
}
}