如何在elasticsearch中的对象中更新嵌套字段
假设我有以下文件:
{
field: {
status: "A"
}
}
我想将状态字段更新为“ b”; 我在Elasticsearch中使用了下面的代码:
client.update({
index: elasticIndex,
id: "anything",
doc: {
"field.status": "B"
}
}).catch(console.error);
得到了:
{
field: {
status: "A"
},
"field.status": "B"
}
有人可以帮忙吗?
Assume I have document below:
{
field: {
status: "A"
}
}
I want to update status field to "B";
I used code below in Elasticsearch:
client.update({
index: elasticIndex,
id: "anything",
doc: {
"field.status": "B"
}
}).catch(console.error);
And got this:
{
field: {
status: "A"
},
"field.status": "B"
}
Could anyone help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下
Try this