Class: Map

Map

Map collection to store a set of Key:Value pairs

Properties:
Name Type Description
sid String Map unique id
Fires:

Methods


get(key)

Parameters:
Name Type Description
key String String identifier of entity in a map
Returns:
Type
Promise.<Item>

getItems(args)

Get a list of items from the Map
Parameters:
Name Type Description
args Object Arguments for query
Properties
Name Type Description
from String Item, which should be used as an anchor. If undefined, starts from the beginning or end depending on args.order
pageSize Number Result page size
order String Order of results, should be 'asc' or 'desc'
Returns:
Type
Promise.<Paginator>

mutate(Key, Mutator)

Parameters:
Name Type Description
Key String Item key
Mutator Map~Mutator Function performing value mutation

remove()

Delete an entity by given key
Returns:
Type
Promise

removeMap()

Delete map from server. It will be impossible to restore it.
Returns:
Promise to delete the collection
Type
Promise

set(key, value [, conditional])

Set key and value pair in map
Parameters:
Name Type Argument Default Description
key String Key identifier
value Object Value to set
conditional Boolean <optional>
false Check for remote modification when updating. If true, promise will be rejected if value was remotely modified
Returns:
Type
Promise.<Item>

update(key, update)

Parameters:
Name Type Description
key String Item key
update Object Set of fields to update
Returns:
Result data
Type
Promise.<Item>

Type Definitions


Mutator(data)

Applies a transformation to the item value
Parameters:
Name Type Description
data Object current value of an item
Returns:
Modified data for an item
Type
Object

Events


collectionRemoved

Fired when Map is removed from server

itemAdded

Fired when item is added to Map
Type: Item

itemRemoved

Fired when item is added to Map
Type: String

itemUpdated

Fired when item is added to Map
Type: Item