2017-10-12 09:02:23 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
|
2021-10-20 04:35:39 +08:00
|
|
|
const collectionOptions = Meteor.isClient ? {
|
|
|
|
connection: null,
|
|
|
|
} : {};
|
|
|
|
|
|
|
|
const Users = new Mongo.Collection('users', collectionOptions);
|
|
|
|
export const CurrentUser = new Mongo.Collection('current-user', { connection: null });
|
2017-10-12 09:02:23 +08:00
|
|
|
|
|
|
|
if (Meteor.isServer) {
|
|
|
|
// types of queries for the users:
|
|
|
|
// 1. meetingId
|
|
|
|
// 2. meetingId, userId
|
2021-10-20 04:35:39 +08:00
|
|
|
// { connection: Meteor.isClient ? null : true }
|
2023-04-01 04:40:41 +08:00
|
|
|
Users.createIndexAsync({ meetingId: 1, userId: 1 });
|
2017-10-12 09:02:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Users;
|