limit search in db

This commit is contained in:
Baris Soner Usakli
2014-01-14 18:04:54 -05:00
parent 75850bd315
commit dcf47f558e
5 changed files with 13 additions and 17 deletions

View File

@@ -97,10 +97,12 @@
}
}
module.search = function(key, term, callback) {
module.search = function(key, term, limit, callback) {
function search(searchObj, callback) {
searchObj
.query(term).type('or')
.query(term)
.between(0, limit - 1)
.type('or')
.end(callback);
}