bigplum/lua-resty-mongol — pull request #34 by fansaien (2014-09-17 01:28:11+00:00)
Title: fix bug that not all records are returned when num_each_query has been s...

local servercount =mongoCollection:count({})
local cursor = mongoCollection:find({},{},0)
local count = 0
for index, item in cursor:pairs() do
count = count+1
end
----out put
servercount = count+101 -- when total count is greater than 101
I found self.i didn't reset when self.resutls had been reassigned in cursor.lua file, so I add localIndex to solve it.