使用 Presto 查询 MongoDB 嵌入/嵌套文档数组

问题描述

假设我有以下文件:

db.inventory.insertMany( [
   { item: "journal",instock: [ { warehouse: "A",qty: 5 },{ warehouse: "C",qty: 15 } ] },{ item: "notebook",instock: [ { warehouse: "C",qty: 5 } ] },{ item: "paper",qty: 60 },{ warehouse: "B",{ item: "planner",qty: 40 },{ item: "postcard",instock: [ { warehouse: "B",qty: 15 },qty: 35 } ] }
]);

我想根据仓库和数量查询库存文档。在 mongo shell 中,我会这样做:

db.inventory.find( { "instock": { $elemMatch: { qty: 5,warehouse: "A" } } } )

我将如何在 Presto 中执行此操作?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)