How can I do a conditional Mongoose query that uses AND and OR?

<>

This question already has an answer here:

Answers


Dylanized,

You could do the following, by using the mongodb Logical Query Operators directly like this:

  Person.find({
      $and: [
          { $or: [{date_begin: null}, {date_begin: {$lte : today}}] },
          { $or: [{date_end: null}, {date_end: {$gte : tommorow}}] }
      ]
  }, function (err, results) {
      ...
  }

Need Your Help

Eclipse "cannot find the tag library descriptor" for custom tags (not JSTL!)

java eclipse jsp taglib custom-tags

I have a Java EE project which build fine with Ant, deploys perfectly to JBoss, and runs without any trouble. This project includes a few custom tag libraries (which is not JSTL!), which are also w...

How to get filename and path of file opened in Notepad?

c# windows winapi

Is it possible to get name with path of a file opened in Notepad. I already have ProcessId of the Notepad.exe.