Fetch to Mongodb database returning an empty array

This a GAIP with SPAM pointing to the same or related AARP side as

Please make sure you boycott AARP.

Despite being a GAIP, most of the things should be verified, as most of the things were already proposed by human.

In particular

because you do not test the return values of create(). I do not know mongoose but I hope there is a return value.

I also suspect that your delete codes have errors. I think it should be MainInfo.deleteOne with an uppercase M rather than mainInfo.deleteOne, and Names.deleteOne with an uppercase N and terminal s rather than name.deleteOne.

To help further please share sample documents from your 2 collections.