EntityAttribute

EntityAttribute

Represents the entity attribute.

Methods

getByEntityId(entityId, orderopt, done) → {Array.<Event>}

Source:

Asynchronously returns all the events that are related to the entity with the given ID.

Parameters:
Name Type Attributes Default Description
entityId String

The given entity ID.

order 'ascending' | 'descending' <optional>
'ascending'

The order of the returned events.

done function

The final callback. Invoked with (err, events).

Returns:

An array of events representing all the value changes for the entity with the given ID.

Type
Array.<Event>

getByValue(valuenullable, orderopt, done) → {Array.<Event>}

Source:

Asynchronously returns all the events that are related to the given value.

Parameters:
Name Type Attributes Default Description
value String <nullable>

The given value.

order 'ascending' | 'descending' <optional>
'ascending'

The order of the returned events.

done function

The final callback. Invoked with (err, events).

Returns:

An array of events representing all the entities whose attribute had/has the given value.

Type
Array.<Event>

getEntityId(value, done) → (nullable) {String}

Source:

Asynchronously returns the ID of the entity whose attribute currently has the given value.

Parameters:
Name Type Description
value String

The given value.

done function

The final callback. Invoked with (err, entityId).

Returns:
Type
String

getValue(entityId, done) → (nullable) {String}

Source:

Asynchronously returns the value of the attribute for the entity with the given ID.

Parameters:
Name Type Description
entityId String

The given entity ID.

done function

The final callback. Invoked with (err, value)

Returns:
Type
String

insert(entityId, newValuenullable, createdAtopt, done) → {Event}

Source:

Inserts a new event.

Parameters:
Name Type Attributes Default Description
entityId String

The entity ID.

newValue String <nullable>

The new value for the attribute.

createdAt Number <optional>
Date.now()

The timestamp of the event. It represents the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.

done function

The final callback. Invoked with (err, event)

Returns:

The newly created event. If the current value for the entity with the given ID is the same as the new value, the returned event is related to the current value.

Type
Event

searchByValue(valuenullable, orderopt, done) → {Array.<Event>}

Source:

Searches for events with a value either equal to the given value or starting with it.

Parameters:
Name Type Attributes Default Description
value String <nullable>

The given value.

order 'ascending' | 'descending' <optional>
'ascending'

The order of the returned events.

done function
Returns:

An array of matching events.

Type
Array.<Event>

searchByValueIgnoreCase(valuenullable, orderopt, done) → {Array.<Event>}

Source:

Searches for events with a value either equal to the given value or starting with it, ignoring case.

Parameters:
Name Type Attributes Default Description
value String <nullable>

The given value.

order 'ascending' | 'descending' <optional>
'ascending'

The order of the returned events.

done function
Returns:

An array of matching events.

Type
Array.<Event>