mongoose-socket
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -26,10 +26,15 @@ 'use strict'; | ||
function postSave(opts, doc) { | ||
var type = opts.type; | ||
var channelFn = opts.channelFn; | ||
var publish = doc.constructor.publish; | ||
var documentObj = doc.toObject(); | ||
var channel = opts.channelFn(documentObj); | ||
var entity = doc.toObject(); | ||
var channel = channelFn(entity); | ||
publish({ | ||
channel: channel, | ||
message: documentObj | ||
message: { | ||
type: type, | ||
entity: entity | ||
} | ||
}); | ||
} |
{ | ||
"name": "mongoose-socket", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Mongoose plugin that publishes socket notifications whenever a document is saved", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
5393
101