Mongodb query bring several records just by passing the name

0

I have this structure

I want to know if through a query I could bring all the products that I have, I mean: put 'Cesar' and bring me all the products. And how would it be?

    
asked by Jose Luis 28.10.2017 в 06:07
source

1 answer

1

If you are asking for a top-level property (in this case " p_nombre ") it is as simple as doing

db.restaurants.find( { "p_nombre": "cesar" } )

This is simply a equality operator

    
answered by 28.10.2017 / 20:25
source