These are chat archives for Automattic/mongoose

Oct 2015
Alex Hatzipanis
Oct 15 2015 03:51

Hi all. I've been stuck on a problem for the last few hours. I'm using the query builder to build a bit of a filter. This works: q.where({ 'organisation.categories.npo': {$in: locals.filters.npo}}) but I want to use a logical OR to build up results from different categories. If I try this:

    { 'organisation.categories.npo': { $in: locals.filters.npo }}, 
    { '': { $in: }}

I get undefined. Can anyone spot what I'm doing wrong?

Alex Hatzipanis
Oct 15 2015 07:29
Never mind, I eventually got there. It turned out sometimes it was looking in a variable like locals.filters.npo which wasn't an array.