2021-03-01

MongoDB - Unwind and show document even if the array is empty

 db.COLLECTION_NAME.aggregate([

    {$unwind: {

        "path": "$FIELD_NAME",

        "preserveNullAndEmptyArrays": true

    }}

]);

No comments:

Post a Comment