Created
October 16, 2012 15:32
-
-
Save dallonf/3900008 to your computer and use it in GitHub Desktop.
Relationships in Deployd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On GET /users | |
// Get all the todos that this user owns | |
if (query.includeTodos) { // Always make something like this a custom query; otherwise it's easy to bog down your server with unnecessary db calls | |
dpd.todos.get({userId: this.id}, function(res, err) { // Assuming that the userId property of a todo is set when you create it | |
this.todos = res; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment