4

I have documents in my collection with a composite _id like this:

_id:{a:"", b:""}

What that I want is to find the document knowing only the value of the field a. Is there some way to do this?

Thanks!

betta7391
  • 103
  • 9

1 Answers1

5

Sure you can do

db.whatever.find({"_id.a":"valueOfa"});

Or did I not got the question?

Rahul Kumar
  • 2,781
  • 1
  • 21
  • 29