Skip to content
develephant edited this page Feb 4, 2016 · 1 revision

Each Mongo document contains a special Object ID object (_id).

Methods:

:tostring

The object id string representation.

Parameters

None

Returns

A string

local id_str = doc._id:tostring()

:get_ts

The timestamp of the object id.

Parameters

None

Returns

Timestamp

local ts = doc._id:get_ts()

:get_pid

The process identifier.

Parameters

None

Returns

A process id.

local pid = doc._id:get_pid()

:get_hostname

The object id hostname.

Parameters

None

Returns

A hostname

local hostname = doc._id:get_hostname()

:get_inc

Unknown usage.

Parameters

None

Returns

Unknown

local inc = doc._id:get_inc()
Clone this wiki locally