How to get Data from mongodb using streams?

Viewed 22

I had a requirement like to fetch the documents which insurance date is going to Expire in 30 days.

I am using below model:

const insurance = await Insurances.find({endDate: {$gte: new Date()}});

Here I am getting 10 documents from these documents I have to filter 30 days of documents using Streams.

How can I use Streams for this concept and I am new to Streams?

0 Answers
Related