bigplum / lua-resty-mongol

A ngx_lua driver for mongodb -- Deprecated for not updating with the mongodb version
198 stars 67 forks source link

Incorrect document about find_one #44

Open arthurxie opened 8 years ago

arthurxie commented 8 years ago
function colmethods:find_one(query, returnfields)
    local id, results, t = self:query(query, returnfields, 0, 1)
    if id == "\0\0\0\0\0\0\0\0" and results[1] then
        return results[1]
    end
    return nil
end

This API returns a document not a single element array when document found.