Get object creation time or _id with Coronium

Hi,

We need a way to get the creation date of the returned objects list from a query. With MongoDB the date is part of the _id field of an object. Unfortunately, when we receive the result of a query we do not have access to the _id field.

Chris, is there a way to retrieve the timestamp of the object part of the query ? If its easier, simply return the _id field and we will convert in on our side. This is not a problem.

thank you

Nick

Hi Nick,

Currently this requires a double call, due to the Lua driver and the way the “id” is set up as a BSON object in Mongo. It’s not as simple as returning a string, I’ve looked at it many times, and it can be done, but I still have always recommended that the developer apply the timestamps to the object directly (for many reasons, including indexing).

I’ll see what I can implement, but it’s not as easy as exposing the “id” object, there is no parity between the languages at that point. A BSON object will never convert 1-1 with a Lua table.

Cheers.

Hi Chris,

In that case, I would say do not bother, we will simply on our side add a timestamp on the object. You don’t need to complicate or slow down the code for this as we have a workaround.

Thanks

Nick

I’ll look into it the next time I boot an instance up, I might be able to provide some lower-level “top-secret” calls.  :wink:

Cheers.

Hi Nick,

Currently this requires a double call, due to the Lua driver and the way the “id” is set up as a BSON object in Mongo. It’s not as simple as returning a string, I’ve looked at it many times, and it can be done, but I still have always recommended that the developer apply the timestamps to the object directly (for many reasons, including indexing).

I’ll see what I can implement, but it’s not as easy as exposing the “id” object, there is no parity between the languages at that point. A BSON object will never convert 1-1 with a Lua table.

Cheers.

Hi Chris,

In that case, I would say do not bother, we will simply on our side add a timestamp on the object. You don’t need to complicate or slow down the code for this as we have a workaround.

Thanks

Nick

I’ll look into it the next time I boot an instance up, I might be able to provide some lower-level “top-secret” calls.  :wink:

Cheers.