【发布时间】:2016-04-14 12:53:05
【问题描述】:
我正在寻找一种逻辑来从 1000 条记录中检索数据库中的数据。我不能在应用程序级别做。
我的数据以两个双字母结尾,例如“ll、gg、ss、ff...”。想从 DB 中检索以上述双字符结尾的单词。
我的示例数据库:
[{
"word": "Floss"
}, {
"word": "smacx"
}, {
"word": "fuzz"
}, {
"word": "grass"
}, {
"word": "dress"
}, {
"word": "puff"
}, {
"word": "cliff"
}, {
"word": "sniff"
}, {
"word": "chess"
}, {
"word": "kiss"
}, {
"word": "fell"
}, {
"word": "shell"
}]
checkarray = ['ll','gg','ll','ss'];
关于如何作为数据库级别执行此操作的任何想法。应用程序级别的循环越来越高,并且需要更多时间,因为它有近 10 万条记录。
【问题讨论】:
标签: node.js mongodb mapreduce sails.js