Mongoose Ratbird猫鼬模式的通知偏好插件
猫鼬鼠鸟偏好使用通知程序首选项扩展您的模式。用法:使用节点包管理器安装插件:npm install mongoose-ratbird
。在您的猫鼬模式中调用:var User = new mongoose.Schema({ // ... }) ; User.plugin(require('mongoose-ratbird'));
。现在,您的mongoose Document将具有通知首选项,这些首选项可以提供给ratbird.Notifier
实例的dispatch()
方法。示例代码如下: var notifier = ratbird.createNotifier(config); // ... notifier.dispatch({ title : 'Some Notification', content : 'Someth' })
。
下载地址
用户评论