zhao/imports/api/collections/Players.js

13 lines
298 B
JavaScript

import { Mongo } from "meteor/mongo";
let Players = new Mongo.Collection("players");
// TODO: there's probably a better way to do this
try {
let collection = Players.rawCollection();
collection.ensureIndex({ name: 1, roomId: 1, }, { unique: true });
} catch (e) {
}
export default Players;