perak / kitchen-examples

Meteor Kitchen examples
164 stars 115 forks source link

Filters with regex like expressions cause kitchen parse error #48

Closed anthonymanzo closed 7 years ago

anthonymanzo commented 7 years ago

Hi, I have a filter I want to use : "filter": "{\"distinguishedname\": { \"$not\":/.*DISABLED.*/}}", But I get the following parse error - Error parsing query "adusers" filter string. Error parsing JSON When I put quotes around the expression, it doesn't fail, but it also isn't correct syntax and the fitler just doesn't work. What to do? Thanks kindly. Tony

perak commented 7 years ago

@anthonymanzo try this:

"filter": "{\"distinguishedname\": { \"$not\": \"new RegExp(/.*DISABLED.*/)\"}}"
anthonymanzo commented 7 years ago

That works great. Thank you. You can close this one!

On Dec 6, 2016, at 12:52 PM, Petar Korponaić notifications@github.com<mailto:notifications@github.com> wrote:

@anthonymanzohttps://github.com/anthonymanzo try this:

"filter": "{\"distinguishedname\": { \"$not\": \"new RegExp(/.DISABLED./)\"}}"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/perak/kitchen-examples/issues/48#issuecomment-265268640, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AH95W5oTktAYZIEfOEWlYc39tmA2zzNXks5rFcsWgaJpZM4LF2Y4.

perak commented 7 years ago

Great 👍