Hey.
Thanks for your reply.

The problem I have is that K is an integer I have to obtain in the first query. I’m currently doing:

K = the alpha-index value obtained in db.myCollection.findOne(lemma:“myString”, alpha-index:1)

And then:
db.myCollection.find({alpha-index: {$gt:(K-25), $lt:(K+25)}})

Can these two queries be condensed into one? I suppose not, because once you find the match for the first query, you need to go back to search the entire collection.

But the thing is, alpha-index is actually an indexed fiend, and on top of that, its values mimic an index (unique integers, consecutive numbers). So I don’t know if there’s a way to extract the documents between K-25 and K+25 without running an additional query on the entire collection and do something more efficient.

I don’t know if I’m being clear here.

Thanks again!!