Details
Description
Count command happily accepts negative skip values, and subtracts them from the count result:
> db.bar.drop()
|
> for(i=0; i < 10; i++){db.bar.insert({a : i})}
|
> db.bar.find().count(true)
|
10
|
> db.bar.find().skip(-5).count(true)
|
15
|
It should probably throw an error if you give it a negative skip (like it does if you leave out the "count" part)