foursquare/fongo — pull request #49 by tom-ohare (2013-07-19 14:14:13+00:00)
Title: Bug when using find() with limit()

I think there's a tiny bug when applying limit() to a find().

I've added a small test case for both limit and skip and, as you can see, the fix is a one-liner (assuming that this is actually a bug - I'm a little suspicious since all I had to do was change <= to <).

While looking into this I also discovered that DBCursor.count() always seems to return a count corresponding to an empty find() ie the whole collection, irrespective of the particular cursor involved (which will often represent a subset of the collection). I'm not sure if that's a bug or if Fongo just doesn't support the full DBCursor functionality so I haven't reported it as an issue. If you do want me to enter an issue for this just let me know. BTW, I have no idea how to fix this.