现有的 log 是这样的
即保存 item_equipped == true 的物品
即获得以下结果:
account 123456789
character abcd
inventory_item {
"item_count": 10,
"item_equipped": false,
"item_name": "魔方",
"item_id": 49255,
"item_type": "12",
},
{
"item_count": 1,
"item_equipped": true,
"item_name": "黄金甲",
"item_id": 40745,
"item_type": "0",
},
{
"item_count": 1,
"item_equipped": false,
"item_name": "白甲",
"item_id": 40746,
"item_type": "0",
},
{
"item_count": 6314,
"item_equipped": true,
"item_name": "黄金箭",
"item_id": 40747,
"item_type": "1",
},
{
"item_count": 631434,
"item_equipped": false,
"item_name": "黄金",
"item_id": 40748,
"item_type": "10",
}
希望能够把非装备的物品,从 inventory_item 中删除。即保存 item_equipped == true 的物品
即获得以下结果:
account 123456789
character abcd
inventory_item {
"item_count": 1,
"item_equipped": true,
"item_name": "黄金甲",
"item_id": 40745,
"item_type": "0",
},
{
"item_count": 6314,
"item_equipped": true,
"item_name": "黄金箭",
"item_id": 40747,
"item_type": "1",
}
请问各位大神有什么方法可以实现?
2 个回复
living
赞同来自: doom
liuxg - Elastic
赞同来自:
POST inventory_item/_delete_by_query
{
"query": {
"match": {
"item_equipped": false
}
}
}