2017-10-12 08:33:57 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
|
2021-10-20 04:35:39 +08:00
|
|
|
const collectionOptions = Meteor.isClient ? {
|
|
|
|
connection: null,
|
|
|
|
} : {};
|
|
|
|
|
|
|
|
const Polls = new Mongo.Collection('polls', collectionOptions);
|
|
|
|
export const CurrentPoll = new Mongo.Collection('current-poll', { connection: null });
|
2017-10-12 08:33:57 +08:00
|
|
|
|
|
|
|
if (Meteor.isServer) {
|
|
|
|
// We can have just one active poll per meeting
|
|
|
|
// makes no sense to index it by anything other than meetingId
|
|
|
|
|
2023-04-01 04:40:41 +08:00
|
|
|
Polls.createIndexAsync({ meetingId: 1 });
|
2017-10-12 08:33:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Polls;
|