blackburn

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

Mongoose Adapter Defined in lib/adapters/mongoose.js

Integrate blackburn with your Mongoose ORM.

typeForRecord (recordoptions)

Given a Mongoose Document, return the type.

Arguments

Returns

(String)

idForRecord (record)

Given a Mongoose Document, return it's id.

Arguments

Returns

(Number,String)

id of the supplied record

attributeFromRecord (recordattributeName)

Fetch a simple attribute from the record.

Arguments

Returns

()

relationshipFromRecord (recordrelationshipNamerelationshipConfig)

Given a record, the relationship name, and the relationship config, return the data for a given record, which could be the ids, an id, the records, or a specific record.

This method takes advantage of the fact that the Document.populated() method either returns the id(s) of the populated record(s), or undefined.

Arguments

Returns

(Array.<Object>,Object,String,Number,Array.<String>,Array.<Number>)

related data

, options