Closed kakakikikeke closed 8 years ago
Hi,
I want to get the below object.
{ "_id" : "hoge", "sInfo" : [ { "sToken" : "testToken", "sTokenExpirationDate" : ISODate("2015-12-15T02:01:06.802Z") } ] }
So, i built a query to get sInfo.sToken. The query is :
local query = { sInfo = { { sToken = "testToken" } } } local r = col:find_one(query) ngx.log(ngx.ERR, r["_id"])
But, the variable of 'r' is nil. How can i get 'sInfo.sToken' ?
Sorry, i just resolved it immediately after i asked you. This is my answer.
local query = {} local key = "sInfo.sToken" query[key] = "testToken" local r = col:find_one(query)
This issus is closed. Thanks.
Hi,
I want to get the below object.
So, i built a query to get sInfo.sToken. The query is :
But, the variable of 'r' is nil. How can i get 'sInfo.sToken' ?