MongoDB - Filtering the content of an internal Array in a resultset

后端 未结 5 548
再見小時候
再見小時候 2021-02-01 08:19

I\'m new using MongoDB, and I don\'t know how to solve the next problem:

I have a collection of documents like this:

{
 \"URL\": \"www.stackoverflow.com\         


        
5条回答
  •  清酒与你
    2021-02-01 09:09

    This might help you.

    The $elemMatch projection operator takes an explicit condition argument. This allows you to project based on a condition not in the query, or if you need to project based on multiple fields in the array’s embedded documents.**

    https://docs.mongodb.com/manual/reference/operator/projection/elemMatch/

提交回复
热议问题