Created
March 14, 2014 12:28
-
-
Save dmackerman/9546777 to your computer and use it in GitHub Desktop.
This file contains 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
// just return the request, to test. | |
function onRequest(request, response, modules){ | |
// fetch all of our kickstart-tpls | |
modules.collectionAccess.collection('kickstarts-tpl').find({}, function(err, kickstartTemplates) { | |
// we need to convert the string to an ObjectId representation??? I've tried it without | |
// this and it still returns nothing. | |
var kickstartTemplateId = modules.collectionAccess.objectID(kickstartTemplates[0]._id); | |
modules.logger.info('kickstart_tpl_id: ' + kickstartTemplateId); | |
// "kickstart_tpl_id: 53220be7f811291203033885" | |
modules.collectionAccess.collection('topics-tpl').find({ "kickstart_tpl_id": kickstartTemplateId }, function(err, topicTemplates) { | |
response.body = topicTemplates; // [ ] | |
response.complete(200); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment