local mongo = require "resty.mongol" conn = mongo:new() conn:set_timeout(1000) ok, err = conn:connect() if not ok then ngx.say("connect failed: "..err) end local db = conn:new_db_handle ( "test" ) col = db:get_col("test") r = col:find_one({name="dog"}) ngx.say(...
Requring the module will return a function that connects to mongod: it takes a host (default localhost) and a port (default 27017); it returns a connection object. mongol = require "resty.mongol" conn = mongol:new() -- return a conntion object ###Connection objects have server wide me...
支持mongodb3.6 example mongol driver for openresty 支持mongodb3.6 example localmongo =require"resty.mongol"conn = mongo:new() conn:set_timeout(1000) ok, err = conn:connect()ifnotokthenngx.say("connect failed: "..err)endlocaldb = conn:new_db_handle ("test") col = db:get_col("test"...
LUA-RESTY-MOONGOOAdding some lua moondust to the mongo gooWhat is it?Lua mongodb driver, highly inspired by perl-mango. Also, möngö is mongolian currency, and mungu is god in Swahili.Table of ContentsRequirements Installation Usage Synopsis Moongoo methods new close db Database methods ...