Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query array property #21

Open
bildsoe opened this issue Oct 2, 2017 · 2 comments
Open

Query array property #21

bildsoe opened this issue Oct 2, 2017 · 2 comments

Comments

@bildsoe
Copy link

bildsoe commented Oct 2, 2017

Hi,

Is it possible to query an array property of a document. Given the following structure of my documents, I want to query for documents where Id15 contains 37330006.

{
  "Id15":["37330006", "37330007", "37330008"],
  "Name":"John Smith",
  "Address":"The street 152",
   "Postal":"90210",
   "City":"BH",
   "Cvr":"1123123234",
   "_id":25953
}

BR
Thomas

@rlindgren
Copy link

rlindgren commented Oct 23, 2017

Have you tried the $in operator?

collection.find({ Id15: { $in: '37330006' } }).toArray()

@betterfuture009
Copy link

It's not working with $in. Could you give me correct way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants