Uncaught Error: There is already a collection named "users/easySearch"


#1

I want to use Meteor.users collection to search these fields but that error keeps appearing, I’ve looked into the documentation page but I’ve found nothing about using Meteor.users

export let UsersIndex = new Index({
    engine: new MongoDBEngine(),
    collection: Meteor.users,
    fields: ['profile.firstname', 'profile.secondname', 'profile.surname', 'profile.lastname'],
    defaultSearchOptions: {
        limit: 8
    }
})

Any type of help is appreciated


#2

It looks like you’re using @matteodem’s easy-search package. He may have a better insight - have you tried raising a GitHub issue?


#3

Not yet, after posting this I deleted matteodem easy-search and solve the problem, but after that two new problems showed up. :sweat_smile:


#4

Hmm. It’s still showing up in those errors - maybe recheck your .meteor/packages file and make sure all easy-search components are removed.


#5

Hi there

I think it has to do with multiple search indexes that are based on the Meteor.users collection. Is that the case?

Edit: the fix is to define a custom “name” attribute http://matteodem.github.io/meteor-easy-search/docs/core/