سؤال

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 ?

هل كانت مفيدة؟

المحلول

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});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top