I want to add to the return data from a mongoose query:
User.findById(userId, function(err, data) { if (!err) { data.newvar = \'Hello, world\'; } });
As it turns out, Mongoose documents are their own special class and not standard Javascript objects. In order to get a javascript option that can be extended, you must use the toObject() method.