It would be nice to handle some simple relationships handling between models.
I propose this configuration:
var UserSchema = new Schema({
name: String,
email: String,
username: String
});
UserSchema.relationships = {
'createdArticles': {
model: 'Article',
direction: 'OUT',
edgeLabel: 'created'
},
'follows': {
model: 'User',
direction: 'OUT',
edgeLabel: 'follows'
},
'followedBy': {
model: 'User',
direction: 'IN',
edgeLabel: 'follows'
}
};
// AND/OR
UserSchema.relationships.add('createdArticles', {
model: 'Article',
direction: 'OUT',
edgeLabel: 'created'
})
What do you think ?
It would be nice to handle some simple relationships handling between models.
I propose this configuration:
What do you think ?