I'm enjoying using this library.
But I can't quite figure out how to get the '_id' of the document I just inserted. E.g.
local db = assert(mongo.Connection.New())
assert(db:connect('localhost'))
local obj = {someKey = "someVal"}
local ans = db:insert('test.someDoc', obj)
print(inspect(ans)) -- 'true'
print(inspect(obj)) -- my original object, unmodified
If I were to do this in Node.js, I could use the optional callback function parameter to 'insert'.
Or, I could look at my inserted obj and expect to see '__id' element tacked on.
But it doesn't appear either mechanism works.