text: // Users
  UsersSchema = new SimpleSchema({
    username: {
      type: String,
      regEx: /^[a-z0-9A-Z_]{3,15}$/
    },
    emails: {
      type: [Object],
      optional: true
    },
    'emails.$.address': {
      type: String,
      regEx: SimpleSchema.RegEx.Email,
      optional: true
    },
    'emails.$.verified': {
      type: Boolean,
      optional: true
    },
    createdAt: {
      type: Date,
      autoValue: function() {
        if (this.isInsert) {
          return new Date;
        } else if (this.isUpsert) {
          return {$setOnInsert: new Date};
        } else {
          this.unset();  // Prevent user from supplying their own value
        }
      }
    },
    services: {
      type: Object,
      optional: true,
      blackbox: true
    }
  });
  
  
  Meteor.users.attachSchema(UsersSchema);
  