我正在尝试学习使用restHeart rest api,看看我是否可以避免任何自定义代码来编写任何java代码来查询MongoDB。
我正在尝试执行以下 mongoshell 查询,知道如何在 RestHeart 请求中编写它吗?
db.getCollection('InsStatData').aggregate({'$match':{'$and':[{ 'sectionName': 'ASSETS'},{'year':2015},{ 'sections.data.rowIdx': 1},{'sections.data.values.colIdx':2}]}},
{ '$unwind': '$sections' },
{ '$unwind': '$sections.data' },
{ '$unwind': '$sections.data.values' },
{'$match':{'$and':[{ 'sectionName': 'ASSETS'},{'year':2015},{
'sections.data.rowIdx': 1},{'sections.data.values.colIdx':2}]}}
)
InsStatData 是 collecitonName。