{"size": 1410, "ext": "js", "max_stars_repo_path": "app/imports/api/user/Users.js", "max_stars_repo_name": "surf-connect/surf-connect", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/imports/api/user/Users.js", "max_issues_repo_name": "surf-connect/surf-connect", "max_issues_repo_issues_event_min_datetime": "2021-11-09T21:28:10.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-16T07:18:14.000Z", "max_forks_repo_path": "app/imports/api/user/Users.js", "max_forks_repo_name": "surf-connect/surf-connect", "max_forks_repo_forks_event_min_datetime": "2021-12-08T21:12:59.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-04T10:09:11.000Z"}
{"max_stars_count": null, "max_issues_count": 20, "max_forks_count": 2, "avg_line_length": 37.1052631579, "max_line_length": 155, "alphanum_fraction": 0.6191489362}
import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
import { Tracker } from 'meteor/tracker';

class UsersCollection {
  constructor() {
    // The name of this collection.
    this.name = 'UsersCollection';
    // Define the Mongo collection.
    this.collection = new Mongo.Collection(this.name);
    // Define the structure of each document in the collection.
    this.schema = new SimpleSchema({
      name: String,
      image: String,
      description: String,
      time: {
        type: String,
        allowedValues: ['12:00am', '1:00am', '2:00am', '3:00am', '4:00am', '5:00am', '6:00am', '7:00am', '8:00am', '9:00am',
          '10:00am', '11:00am', '12:00pm', '1:00pm', '2:00pm', '3:00pm', '4:00pm', '5:00pm', '6:00pm', '7:00pm', '8:00pm', '9:00pm', '10:00pm', '11:00pm'],
        defaultValue: '12:00am',
      },
      ability: {
        type: Number,
        allowedValues: [1, 2, 3, 4, 5],
        defaultValue: 1,
      },
      owner: String,
    }, { tracker: Tracker });
    // Attach the schema to the collection, so all attempts to insert a document are checked against schema.
    this.collection.attachSchema(this.schema);
    // Define names for publications and subscriptions
    this.userPublicationName = `${this.name}.publication.user`;
    this.adminPublicationName = `${this.name}.publication.admin`;
  }
}

export const Users = new UsersCollection();
