Class: Record

Record


new Record(props, opts)

js-data's Record class.

import {Record} from 'js-data'
Parameters:
Name Type Argument Description
props Object <optional>

The initial properties of the new Record instance.

opts Object <optional>

Configuration options.

Properties
Name Type Argument Default Description
noValidate boolean <optional>
false

Whether to skip validation on the initial properties.

Source:

Methods


<static> extend(props, classProps)

Create a Record subclass.

var MyRecord = Record.extend({
  foo: function () { return 'bar' }
})
var record = new MyRecord()
record.foo() // "bar"
Parameters:
Name Type Argument Default Description
props Object <optional>
{}

Properties to add to the prototype of the subclass.

classProps Object <optional>
{}

Static properties to add to the subclass.

Source:
Returns:

Subclass of Record.

Type
function

afterLoadRelations(relations, opts)

TODO

Parameters:
Name Type Description
relations Array.<string>

TODO

opts Object

TODO

Source:

afterSave(opts)

TODO

Parameters:
Name Type Description
opts Object

TODO

Source:

beforeLoadRelations(relations, opts)

TODO

Parameters:
Name Type Description
relations Array.<string>

TODO

opts Object

TODO

Source:

beforeSave(opts)

TODO

Parameters:
Name Type Description
opts Object

TODO

Source:

changes(key)

TODO

Parameters:
Name Type Argument Description
key string <optional>

TODO

Source:

commit()

TODO

Source:

create(opts)

TODO

Parameters:
Name Type Argument Description
opts Object <optional>

Configuration options. See Mapper#create.

Source:

destroy(opts)

TODO

Parameters:
Name Type Argument Description
opts Object <optional>

Configuration options. @see Model.destroy.

Source:

emit(event)

Trigger an event on this Record.

Parameters:
Name Type Description
event string

Name of event to emit.

Source:

get(key)

Return the value at the given path for this instance.

Parameters:
Name Type Description
key string

Path of value to retrieve.

Source:
Returns:

Value at path.

Type
*

hasChanges()

TODO

Source:

hashCode()

TODO

Source:

loadRelations(relations, opts)

TODO

Parameters:
Name Type Argument Description
relations Array.<string> <optional>

TODO

opts Object <optional>

TODO

Source:

off()

Remove an event listener from this Record.

Source:

on()

Register a new event listener on this Record.

Source:

previous(key)

TODO

Parameters:
Name Type Argument Description
key string <optional>

TODO

Source:

revert(opts)

TODO

Parameters:
Name Type Argument Description
opts Object <optional>

Configuration options.

Source:

save(opts)

TODO

Parameters:
Name Type Argument Description
opts Object <optional>

Configuration options. See Mapper#create.

Source:

schema(key)

TODO

Parameters:
Name Type Argument Description
key string <optional>

TODO

Source:

set(key, value, opts)

Set the value for a given key, or the values for the given keys if "key" is an object.

Parameters:
Name Type Argument Description
key string | Object

Key to set or hash of key-value pairs to set.

value * <optional>

Value to set for the given key.

opts Object <optional>

Optional configuration.

Properties
Name Type Argument Default Description
silent boolean <optional>
false

Whether to trigger change events.

Source:

unset(key, opts)

Unset the value for a given key.

Parameters:
Name Type Argument Description
key string

Key to unset.

opts Object <optional>

Optional configuration.

Properties
Name Type Argument Default Description
silent boolean <optional>
false

Whether to trigger change events.

Source: