當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。