Reputation: 613
I would like to know if the username, email addresses and profile name of the Meteor.users collection are indexed if not is there a way to index them ?
does it cost much to run regex on this field without them being indexed ?
Upvotes: 0
Views: 617
Reputation: 8928
These are the indexes Meteor currently ensures on the users
collection -- from accounts_server.js
/// DEFAULT INDEXES ON USERS
Meteor.users._ensureIndex('username', {unique: 1, sparse: 1});
Meteor.users._ensureIndex('emails.address', {unique: 1, sparse: 1});
Meteor.users._ensureIndex('services.resume.loginTokens.token',
{unique: 1, sparse: 1});
Upvotes: 3