Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform highlighting doesn't work on _id #55

Open
dkmooers opened this issue Apr 7, 2016 · 1 comment
Open

Transform highlighting doesn't work on _id #55

dkmooers opened this issue Apr 7, 2016 · 1 comment

Comments

@dkmooers
Copy link

dkmooers commented Apr 7, 2016

If I use this transform function for highlighting search results:

transform: function(matchText, regExp) {
    console.log(matchText, regExp);
    return matchText.replace(regExp, "<b>$&</b>");
},

And I use '_id' as one of the search fields, I get the following error when I search:

Exception in template helper: Error: transformed document can't have different _id
    at wrapped [as _transform] (http://localhost:3000/packages/minimongo.js?hash=9b1463853801ce7302ecca3eac339c514a0341db:1174:15)
    at http://localhost:3000/packages/minimongo.js?hash=9b1463853801ce7302ecca3eac339c514a0341db:200:18
    at Array.forEach (native)
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=8de51f9d86e95ae2ffee15a8db324a1decccba3e:139:11)
    at LocalCollection.Cursor.forEach (http://localhost:3000/packages/minimongo.js?hash=9b1463853801ce7302ecca3eac339c514a0341db:195:5)
    at LocalCollection.Cursor.fetch (http://localhost:3000/packages/minimongo.js?hash=9b1463853801ce7302ecca3eac339c514a0341db:238:8)
    at SearchSource.getData (http://localhost:3000/packages/meteorhacks_search-source.js?hash=0b4c91bf433d5d896a2beba7db436da54fc8f842:184:17)
    at Object.invoices (http://localhost:3000/app/app.js?hash=476b27c1277f65d46aa8bc18f3c3d4243f7322ec:1049:45)
    at http://localhost:3000/packages/blaze.js?hash=38069f4f7cfbd8898160bc97d37dd847cd5985fe:2984:16
    at http://localhost:3000/packages/blaze.js?hash=38069f4f7cfbd8898160bc97d37dd847cd5985fe:1643:16

Is there any way to get _id searching / transforming to work?

@gabrielps
Copy link

I have the same issue. Anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants