Pergunta

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 ?

Foi útil?

Solução

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});
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top