Mongodb aggregation to pass both a matched array and an unmatched array

I’ve got a MongoDB / Nodes aggregation that looks a little like this (there are other values in there, but this is the basic idea).

        [
        {
        '$unwind': {
            'path': '$Vehicles'
            }
        },
        {
        '$match': {
            'Vehicles.Manufacturer': 'FORD'
            }
        },
        {
        '$facet': {
            'makes': [
                    {
                '$group': {
                '_id': '$Vehicles.Manufacturer', 
                'count': {
                    '$sum': 1
                            }
                        }
                    }
                ]
            }
        },
        {
        '$project': {
            'makes': {
            '$sortArray': {
                'input': '$makes', 
                'sortBy': 1
                    }
                }
            }
        }
    ]

This works fine. But I would also like to pass an unmatched list through. IE an an array of vehicles whose Manufacturer = FORD and an other list of all Manufacturer.

Can’t get it to work. Any ideas please?

Thanks in advance.

If you want

you have to remove

Thanks, but no, because I need both the matched and unmatched lists.

Use two different queries maybe?

It will be very very hard, aka impossible, to have unmatched documents available after your $match. So your $match has to be removed. Only documents with

are available to your next $facet stage.

But you have a $facet with

This actually gives you your matched and unmatched list. The matched one is with _id:FORD and the unmatched is all the others. But to get the unmatched one in the $facet you have to remove the $match.