Chapter 2: The MongoDB Query Language + Atlas Reading Documents: Array Fields

I am trying to execute a query in mongo shell that will return the writers that contain Ethan Coen and Joel Coen. This is the syntax I am using when I execute it the shell displays … I am not sure why it does not return anything?

db.movies.find({“writers”:{ $in :[“Ethan Coen”, “Joel Coen”]}).count()

If I run this filter in compass I get a result
{
filter: {
writers: {
$in: [
‘Ethan Coen’,
‘Joel Coen’
]
}
}
}

Any advice would be great

Potentially using the wrong database.

By the way, if you’re asking a question about a lab, please don’t post potential answers as it’s against forum guidelines.

I will review my connection and let you know. Thank-you

To get the name of the current db, you can type one of:
db
db.getName()

You are correct I was on the course db and not my own cluster sorry for the confusion. this can be closed

Only MongoDB Curriculum Services team can close tickets, but there’s a “Solved” button under each post that you can use.

Closing this thread as the issue has been resolved.