blackburn

Drop-in serializer support for Express/Connect Node apps.

Adapter Defined in lib/adapter.js

Adapters let the blackburn talk to your models, regardless of what ORM you are using. They are essentially a small shim / translation layer between your ORM and blackburn.

idForRecord (recordoptions)

Given a record, return it's id.

Arguments

Returns

(String,Number)

id for the record

typeForRecord (recordoptions)

Given a record, return it's type.

Arguments

Returns

(String)

the type of the record

attributeFromRecord (recordattributeNameoptions)

Given a record and attribute name, return the value of the attribute.

Arguments

Returns

()

the value of the attribute

relationshipFromRecord (recordrelationshipNamerelationshipConfigoptions)

Return the requested relationship from the supplied record. The returned object must contain the type of the related records, and optionally can include any of the following:

Arguments

Returns

(Object)

the relationship descriptor, which should include an id, ids, record, or records property based on the supplied