If limit is 1, and batchsize is 0, DBApiLayer.chooseBatchSize will return -1, and the cursor will be closed as a result.
in DBApiLayer.chooseBatchSize, I see
if (res == 1)
Code to replicate
I have 4 entries in the collection
DB m = Mongo.connect(new DBAddress("host", "dbname"));
DBCursor c1 = m.getCollection("mycoll").find();
int count1 = 0;
while (c1.hasNext())
System.out.println("Count 1 is: " + count1);
DBCursor c2 = m.getCollection("buttons").find().skip(2).limit(1);
int count2 = 0;
while (c2.hasNext())
System.out.println("Count 2 is: " + count2);
Output:
Count 1 is: 4
Count 2 is: 0