当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Mongo.Collection._ensureIndex方法代码示例

本文整理汇总了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;
开发者ID:paralin,项目名称:evewaitlist,代码行数:31,代码来源:waitlist.ts

示例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;
开发者ID:paralin,项目名称:evewaitlist,代码行数:31,代码来源:characters.ts


注:本文中的meteor/mongo.Mongo.Collection._ensureIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。