prevent MongoDB aggregate with $match from returning an empty Array

I have an aggregate function like this

 app.get('/feed', (req, res) => {
   { $sample: {size: 5} },
   { $match:  {"published": true} },

Now if aggregate finds a document that doesn’t satisfy {published: true} it simply returns an empty array

So in many Use cases, I get 4 or 3 documents in return array instead of 5

I want this function to always return 5 random documents with $match criteria no matter what!!

How can I achieve this please explain?


Move $match condition to the top ?

   { $match:  {"published": true} },
   { $sample: {size: 5} }