mongoosejs / mongoose-text-search

MongoDB 2.4 text search support for mongoose
154 stars 9 forks source link

Pagination #7

Closed Gionni closed 10 years ago

Gionni commented 10 years ago

I'm not sure if pagination is possible with mongoose-text-search.

In my local mongo 2.6, I put all the find options together using this from node/mongoose:

var query = Contact.find(findOpt); query.count(function(err, count) { query.skip((req.query.page-1)*numContactsPerPage).limit(numContactsPerPage). exec('find', function(err, contacts) { ... }); });

But now using conservative mongolab/mongohq mongo 2.4, I don't know how to do it.

Any suggestion? Thanks.

aheckmann commented 10 years ago

Mongo 2.4 didn't support paging text search results.