【发布时间】:2015-06-09 14:42:38
【问题描述】:
我有一个庞大的集合只包含这种文档。
{
"_id" : "https://example.com/test.html",
"Count" : 1503.0000000000000000
},
{
"_id" : "http://example.org/gr/",
"Count" : 715.0000000000000000
},
{
"_id" : "https://example.com/document/d//edit",
"Count" : 710.0000000000000000
},
{
"_id" : "http://example.org/gr/test.htm",
"Count" : 429.0000000000000000
}
}
如何使用 mongodb 聚合框架来实现这个结果。
{
"_id" : "https://example.com/",
"Count" : 2213.0000000000000000
},
{
"_id" : "http://example.org/",
"Count" : 1144.0000000000000000
}
}
在 $project 管道中拆分后具体如何使用文本搜索?
提前致谢!!
【问题讨论】:
标签: mongodb mongoose mongodb-query