本文整理匯總了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;