1

I'm trying to do something like:

filter.or = [
  { name: { contains: q } },
  { "location.city": { contains: q } }
];

However it seems that "location.city", trying the MongoDB query language, is not working.

How can I achieve this?

Thanks!

gonzalomelov
  • 971
  • 1
  • 13
  • 30
  • 1
    Share your entire model call and version info (sails, waterline & sails-mongo, because that works fine for me. I just tested the exact same query your showing above on some data I have in mongo via sails console and it works. – Meeker Mar 11 '15 at 16:56
  • Okay, wait me some minutes and I will do it. Thanks for your response – gonzalomelov Mar 11 '15 at 17:12
  • Here is query I ran from a set of data I have on my site. I made sure the first OR would come up as false, so in order for the query to show data the sub-document query would have to come up true. . . and it did. It's basically the same as yours Order.find({or:[{videoProgress:10000},{"charge.object":{contains:'charge'}}]}).exec(console.log) – Meeker Mar 11 '15 at 17:39

0 Answers0