1. 首页
  2. 数据库
  3. 其它
  4. meteor collection helpers::gear:Meteor软件包可让您在收藏中定义助手 源码

meteor collection helpers::gear:Meteor软件包可让您在收藏中定义助手 源码

上传者: 2021-04-20 22:27:39上传 ZIP文件 4.37KB 热度 3次
流星收集助手 集合助手使用Meteor的Mongo.Collection transform选项自动在您的集合上设置transform ,从而允许具有类似于模板助手的界面的简单模型。 安装 $ meteor add dburles:collection-helpers 用法 将您的助手写在客户端和服务器都可以看到的地方。 Books = new Mongo . Collection ( 'books' ) ; Authors = new Mongo . Collection ( 'authors' ) ; Books . helpers ( { author ( ) { return Authors . findOne ( this . authorId ) ; } } ) ; Authors . helpers ( { fullName ( ) { retu
下载地址
用户评论