Julien

Results 5 comments of Julien

How do you @hagopj13 use the solution of @pxl-live ? I've tested it on my side and it doesn't seem to work... All requests to my socket are catched here...

I found an alternative ``` let server = require('http').createServer(app); mongoose.connect(config.mongoose.url, config.mongoose.options).then(() => { logger.info('Connected to MongoDB'); const options = {cors: true, origins:'*'}; const io = require('socket.io')(server, options); io.on('connection', socket =>...

I face a similar problem (by using [toJSON](https://github.com/hagopj13/node-express-boilerplate/blob/d3d3e0f9de562bbeda7d4f0c3c5b4e776ff534e4/src/models/plugins/toJSON.plugin.js)), I also using an aggregation function. It seems that plugins attached to a schema are not taken when calling an aggregation function....

Glad that you found a workaround for your problem! Yes, it works but it is not what I expect. According to [the implementation of toJSON, ](https://github.com/hagopj13/node-express-boilerplate#tojson), it - removes __v,...

My workaround, hoping to find a more elegant solution. ```js // rename _id to id { $addFields: { id: '$_id', }, }, // remove _id and __v { $project: {...