Rohan Sethi
Rohan Sethi

Reputation: 115

Correct way for this Mongo Query

enter image description here

This is what I have tried for the structure :

db.briefing.find(
{
  leg : {
  $elemMatch :  {legidentifier : "2A.1003.30Aug2016.BOG.LHR.A"}
  }
}
)

This yeilds no results.Where I'm going wrong ?

Upvotes: 0

Views: 17

Answers (1)

krishna
krishna

Reputation: 499

In DB legIdentifier is saved as legIdentifier but in your query you are giving identifier in lower case legidentifier.

MongoDB is case-sensitive.

Upvotes: 1

Related Questions