Lab 2.1 query cannot be executed

For lab 2.1,this query is not working in compass.Please help.

error2

Hi Joseph_89514,

Please delete this query and write or just replace the double-quotes. Sometimes, when we copy-paste text, some special characters like double quotes get messed up!

Let me know if it works!

Kanika

I’m seeing similar error on my end when trying to filter the dataset. The Find button doesnt allow to filter. How do I fix this?

Hema, you need to specify your filter in the correct notation. Try

{genres: “Comedy”}

1 Like

Hi Hema_95419,

The find query needs to be enclosed with curly brackets { }.

Use something like this:

  { genres: "Comedy" }

Kanika

1 Like

That worked. Thanks for your help.

I had a similar issue when following the video m001 lesson 2.6
In that video, Shannon enters a filter of {wind.type: “C”} which works in that version of Compass.
I get an error when I use the same query in Compass version 1.19.6. The filter button is red and the find button disabled.

The syntax that works for me in Compass version 1.19.6 is
{“wind.type”: “C”}
or
{‘wind.type’: ‘C’}

This has most likely been updated in compass to be consistent with the syntax used in the shell where as the video mentions, quotes must be used when using dot notation in the shell.

Hi @Paul_63020,

With current versions of Compass, whenever the . operator is used on a key to indicate a child key such as “wind.type” or when using the . operator to use a positional query such as “sections.0”, the key must be surrounded in quotes.

The same has been mentioned in the lecture notes Lecture: Reading Documents: Scalar Fields.

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

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer