本文整理汇总了TypeScript中meteor/mongo.Mongo.Collection._ensureIndex方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Mongo.Collection._ensureIndex方法的具体用法?TypeScript Mongo.Collection._ensureIndex怎么用?TypeScript Mongo.Collection._ensureIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meteor/mongo.Mongo.Collection
的用法示例。
在下文中一共展示了Mongo.Collection._ensureIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
// tslint:disable-next-line
export const Waitlists = new Mongo.Collection<IWaitlist>('waitlist');
this.Waitlists = Waitlists;
if (Meteor.isServer) {
Waitlists._ensureIndex({finished: 1});
}
export interface IStats {
logi: number;
dps: number;
other: number;
}
export interface ISquad {
id: number;
wing_id: number;
}
export interface ISquadInfo {
logiSquad?: ISquad;
dpsSquad?: ISquad;
otherSquad?: ISquad;
}
export interface IFleetMember {
id: number;
name: string;
示例2:
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
// tslint:disable-next-line
export let Characters = new Mongo.Collection<ICharacter>('characters');
this.Characters = Characters;
if (Meteor.isServer) {
Characters._ensureIndex({uid: 1, waitlist: 1, active: 1});
}
export interface IFit {
dna: string;
shipid: number;
fid: string;
primary: boolean;
comment?: string;
}
export interface ICharacter {
_id?: string;
uid: string;
name: string;
banned: boolean;
system?: string;
systemid?: number;
stationname?: string;
stationid?: number;
corpname: string;
corpid: number;
shipname?: string;