While I normally don't like "suggest packages to do x" types of questions, this one did pique my interest. I did a quick Google search (ironic that I can't use ChatGPT to find these - and yes, I do know the reason why). While there's a lot of noise in the results, the one that was at the top of the list was
GitHub - rpopuc/nl-mongodb-query-builder: A proof of concept application that converts natural language queries into MongoDB database pipelines using the OpenAI API.[
^]. Note that this is queries only, so there's no adding data into the database with it, but if you want "How many aeroplanes landed at Schiphol yesterday?" type queries, this looks very promising.
Of course, the chances that MongoDB didn't have an offering in this space was zero, so I did a search around what they have to offer. Rather than roll your own solution, you could always use the official
Compass[
^] offering. This uses Azure OpenAI at the heart of the queries.