Closed lywaterman closed 10 years ago
What is the purpose? I don't see the use case. Thanks
now you can use it like this: function inc_oid(num)
local res = db:run_command(region, { cmd = 'findAndModify', ["findAndModify"] = 'etc', ["query"] = {['type']='oidbase'}, ['update'] ={['$inc'] = {['oidbase'] = mongo.NumberInt(num)}}, ['new']=true } ) return res end
Doing this, it will be different from the documentation of MongoDB http://docs.mongodb.org/manual/reference/command/findAndModify/#dbcmd.findAndModify
I don't like to introduce these differences in the driver. It will be easy for you to implement a Lua function wrapper which does the same thing. Is it possible or I'm wrong?
I see your point, I'm testing findAndModify using run_command method, and it is failing because the first field in bson table is not the corresponding command. Proceeding to merge the pull request. thanks!
treat the command be a table