1. 首页
  2. 考试认证
  3. 其它
  4. Mongoose Ratbird猫鼬模式的通知偏好插件

Mongoose Ratbird猫鼬模式的通知偏好插件

上传者: 2024-10-31 02:25:21上传 ZIP文件 5.04KB 热度 9次

猫鼬鼠鸟偏好使用通知程序首选项扩展您的模式。用法:使用节点包管理器安装插件: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' })

下载地址
用户评论