It seems there is a issue inserting Date type.
For instance, I have a code to create new user with created_at field.
local mongo = require "resty.mongol"
local bson = require "resty.mongol.bson"
local now = bson.get_utc_date(ngx.time() * 1000)
local data = {
user = 1,
created_at = now
}
local db, err = mongo:new(XXXXX)
local user = db:get_col("user")
local res, err = user:insert({data}, nil, true)
Data stored in created_at is actually {"v"=>1469128796000} and the value 1469128796000 is stored as int64 type, not mongo's Date type.
Does anybody has same issue or a suggestion to fix it?
It seems there is a issue inserting
Date
type. For instance, I have a code to create new user withcreated_at
field.Data stored in
created_at
is actually{"v"=>1469128796000}
and the value1469128796000
is stored asint64
type, not mongo'sDate
type. Does anybody has same issue or a suggestion to fix it?Thanks