Return documents respectively fullDocuments from a change stream?

Let’s say I’ll post a list of testcases to my mongo database. Thereby each testcase is a document.

Now I have a change stream that reacts to the inserts of the new testcases.

How can I return testcase by testcase (fullDocument of the testcase documents) from the change stream e.g. as JSON or something similiar?

What I tried?

export async function dbListener() {
    connectToMongoDB();

    const scheduledJob = CronJob.schedule('*/10 * * * * *', async () => {
        const testCases: string[] = [];
        const changeStream = TestCase.watch([], { fullDocument: 'updateLookup' }) as ChangeStream<ITestCaseModel>;

        changeStream.on('change', (data) => {
            const testCase = JSON.stringify(data.fullDocument);
            testCases.push(testCase);
        })

        // console.info(testCases);
    });

    scheduledJob.start();
}

Tried to stringify the fullDocuments and push it to an array of type string. To use that array for my tests. But when console log it it just shows an empty array. So doesn’t work.

export async function dbListener() {
    connectToMongoDB();

    const scheduledJob = CronJob.schedule('*/10 * * * * *', async () => {
        const changeStream = TestCase.watch([], { fullDocument: 'updateLookup' }) as ChangeStream<ITestCaseModel>;

        changeStream.on('change', (data) => {
            fs.writeFile('testcases.json', JSON.stringify(data.fullDocument), ...);
        })

        // console.info(testCases);
    });

    scheduledJob.start();
}

I also tried something similar like this, so when a change was detected it should write the fulldocument to a file. To use it for the tests. But that also doesn’t work.

What would be the suggested way to return the document data from a change stream?