【发布时间】:2014-01-06 10:40:46
【问题描述】:
我们有一个架构:
stores:
{_id , name}
getways:
{_id, store_id }
txes:
{tx_id,getway_id}
一个store有很多getway,getway有很多txes。
我们需要特定商店的交易数量。
SQL:
SELECT count
FROM txes
WHERE getway_id IN (SELECT _id
FROM getways
WHERE store_id = xxxx)
在mongo查询中怎么写?
我在 jaspersoft studio mongo 查询中编写了这个查询。
【问题讨论】:
-
我不知道 jaspersoft 但是,MongoDB 还不支持服务器端子查询