Chapter 3 Logical Operator Quiz - Shell v's Compass

Hi All,

I am getting differing results from what I think is the same filter when applied in shell and compass? I am sure I’m connecting to the same cluster in both cases…

In compass I get a result and that result was correct as far as the quiz was concerned. When I run the same filter in shell I get a result of 0. I have speech marks in all cases for keys and values…

For Compass:
{ $or : [ { “watlev”: “always dry” }, { “depth” : 0 } ] }

For Shell:
db.shipwrecks.count( { $or : [ { “watlev”: “always dry” }, { “depth” : 0 } ] } )

any suggestions?

Hi @Daniel_88997,

Please use neutral quotation marks "" and your query will work fine.

db.shipwrecks.count({$or:[{"watlev":"always dry"},{"depth":0}]})

if you have any other query, please feel free to get back to us.

Happy Lerarning :slight_smile:

Shubham Ranjan
Curriculum Support Engineer

Thank you … I assume this is a result of my text package auto correcting for my convenience :smiley: I will be on the look out for that in the future :+1: