0

I try to query the data and hope it can return a object.

My data structure looks like this:

enter image description here

I want to query the movie array the enName is Terminal and return which is the query conditions objects.

I try to use

db.getCollection('Keelung').find({"movie":{"enName": 'Terminal'}})

in Robo3T shell, it will return Fetched 0 record(s) in 1ms

Then I think it should loop the element movie array

So I try this

db.getCollection('Keelung').find({movie: {$elemMatch: {enName:'Terminal'}}})

But it will return the document Keelung the result almost like db.getCollection('Keelung').find({}) that is not what I want.

I have no idea what should I try next.

Any suggestion would be appreciated. Thanks in advance.

Thomas Vangelooven
  • 1,641
  • 2
  • 11
  • 18
Morton
  • 4,898
  • 16
  • 49
  • 103

0 Answers0