Click here to Skip to main content
16,022,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I'm building a simple full stack application that takes user input and convert it into MongoDB query and then give the query output to user.

What I have tried:

I have found nlp.js package that can be used with Nodejs but I want some more options to be available so that I can experiment with them as well.
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900