Skip to content

Instantly share code, notes, and snippets.

View iamkale's full-sized avatar

Michael Hoglund | GRIT iamkale

View GitHub Profile
@iamkale
iamkale / query
Created July 13, 2012 13:05
Populate in mongoose
var mongoose = require('mongoose');
var Event = mongoose.model('Event');
var Calendar = mongoose.model('Calendar');
function eventController(app) {
app.get('/calendar/:calendarid', function (req, res) {
Calendar
.findOne({ _id:req.params.calendarid })
.populate('events')