本文整理汇总了TypeScript中meteor/mongo.Mongo.Collection.helpers方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Mongo.Collection.helpers方法的具体用法?TypeScript Mongo.Collection.helpers怎么用?TypeScript Mongo.Collection.helpers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor/mongo.Mongo.Collection
的用法示例。
在下文中一共展示了Mongo.Collection.helpers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: moment
import { MongoObservable } from "meteor-rxjs";
import { Mongo } from 'meteor/mongo';
import * as moment from "moment";
import { PlacesModel } from '../models/places.model';
let Places = new Mongo.Collection('places');
// fraction() {
// return Fractions.findOne(this.fractionId);
// }
Places.helpers({
getCreatedAtDate() {
return moment(this.createdAt).format("DD.MM.YYYY HH:mm");
}
});
Places.attachSchema(PlacesModel);
export const PlacesCollection = new MongoObservable.Collection(Places);
示例2: moment
import { MongoObservable } from "meteor-rxjs";
import { Mongo } from 'meteor/mongo';
import * as moment from "moment";
import {FractionsCollection} from "fractions.collection";
import { CharactersModel } from '../models/characters.model';
let Characters = new Mongo.Collection('characters');
// fraction() {
// return Fractions.findOne(this.fractionId);
// }
Characters.helpers({
// getFraction() {
// FractionsCollection.findOne({ _id: this.fractionId });
// },
getCreatedAtDate() {
return moment(this.createdAt).format("DD.MM.YYYY HH:mm");
}
});
Characters.attachSchema(CharactersModel);
export const CharactersCollection = new MongoObservable.Collection(Characters);