I was learning some mongodb stuff, and it’s pretty awesome!
I decided to try it out with mongoose in node and came upon the realization that I have no idea how to run an or command, so I looked up how you would do an or command in regular mongoose and found that the query is similar to this:
db.meh.find({ $or : [ { a : 3 }, { b : 4 } ] });
And that seems to work great with the command line program for finding all entities where a == 3 or b == 4
But… How would I do this in mongoose?
Any help is appreciated!!
Note I also would like to be able to do this with the findOne() method, but I’m assuming that it’ll act just the same as find() with a limit on it
It should be the same in mongoose.
Yea, that should work as well.