Target object DXN.
The reference target.
May return undefined
if the object is not loaded in the working set.
Accessing this property, even if it returns undefined
will trigger the object to be loaded to the working set.
Serializes the reference to a JSON object. The serialization format is compatible with the IPLD-style encoded references. When a reference has a saved target (i.e. the target or object holding the reference is not in the database), the target is included in the serialized object.
Examples:
{ "/": "dxn:..." }
{ "/": "dxn:...", "target": { ... } }
Promise that will resolves with the target object. Will load the object from disk if it is not present in the working set.
Do not inline the target object in the reference. Makes .target unavailable unless the reference is connected to a database context.
When serialized with toJSON, the difference is between:
{ "/": "dxn:..." }
and
{ "/": "dxn:...", "target": { ... } }
Promise that will resolves with the target object or undefined if the object is not loaded locally.
Represents materialized reference to a target. This is the data type for the fields marked as ref.