aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 137 forks source link

improve fieldMatches #402

Closed s7dhansh closed 8 years ago

s7dhansh commented 8 years ago

a.0.b will yield - a, a.0, a.0.b as well as "a.b", so that if "a.b" is being projected, "a.0.b" field can be filtered upon.

s7dhansh commented 8 years ago

@aslagle could you kindly have a look at it?

aslagle commented 8 years ago

Thanks for finding this. It's confusing that there's some inconsistency between Collection's field operators on the client and server, but I think I understand the problem.

I'm not sure this fix is specific enough though - it looks like it would also allow filtering on a field called "a.0b" if "a.b" is projected, which isn't right. I'd like to have some tests around this before merging anything.

s7dhansh commented 8 years ago

@aslagle yes you are right. Would a change in regex do or do you have something completely different in mind?

aslagle commented 8 years ago

Changing the regex is fine. I just want to make sure we've thought through all the cases.

aslagle commented 8 years ago

@s7dhansh Don't you need to replace with a "." instead of "" now that both dots are in the regex?

s7dhansh commented 8 years ago

Yes thank you. I completely failed to notice it. I was using the earlier version in my code, so did not even find the bug :/

aslagle commented 8 years ago

Thanks! Published v0.8.32.