Config in Code
Defining collections in code rather than in type.properties:
StoryController = {
edit_action: function() {
var stories = Story.collection({filter: "x = 'bar'",
accessname: "dongle",
order: "MOOPAD"});
var story = stories.get(req.form.id);
story.name = req.form.name;
}
}
Defining object/relational mapping in code rather than in type.properties
Story.mapping = {
id: "id",
name: "name",
author: User.reference("author_id"),
comments: Comment.collection({local: "id"; foreign: "story_id"})
}