0

What I what is a query with offset and limit of one, that when the offset is bigger than the count it returns the first one.

For example: if I have a collecton with 3 elements and I do a query with offset = 4 I will get the first element. Any idea of how to implement this?

4

1 回答 1

1

先做一个count(),如果这个数字小于你的偏移量,做一个findOne?

于 2013-10-02T18:42:43.683 回答