Query Object list
                
                Answered
            I have a collection named 'vendors' and there is a field called 'products' in that collection.The products field is a collection of object.Each object contains a 'productno' and 'productname' field. How can I get a products with a specific 'productno'?
                                                                    
            
            
            The same question        
I seems that you need $elemMatch.
db.vendors.find({ products: { $elemMatch: { productno: 123, productname: "abc" }} })or user our fluid query:db.vendors.where("products").elemMatch({productno:123, productname:"abc"})I seems that you need $elemMatch.
db.vendors.find({ products: { $elemMatch: { productno: 123, productname: "abc" }} })or user our fluid query:db.vendors.where("products").elemMatch({productno:123, productname:"abc"})Replies have been locked on this page!