MongoDB
The Turboline.NLQ2SQL.MongoDB
package allows developers to convert natural language queries into MongoDB queries. It simplifies interactions with MongoDB databases, enabling non-technical users to query databases using natural language through a .NET application. This package is especially useful for building AI-driven dashboards or applications, integrating easily into projects by configuring a connection string, API key, and other settings.
Download Nuget Package
Download your package here.
Objective
To integrate MongoDB Turboline Packages into your application efficiently and effectively.
Key Steps
- Create a blank project using the ASP.NET web app model view controller.
- Choose .NET 8.0 for the project.
- Select individual accounts for authentication.
- Install the MongoDB & Turboline.AI.API.Client.Razor package from NuGet packages.
dotnet add package Turboline.NLP2SQL.MongoDB
dotnet add package Turboline.AI.API.Client.Razor
- Add code in the program.cs file:
- Add namespace using
Turboline.NLQ2SQL.MongoDB;
. - Add
builder.Services.EnableTurbolineDashboard(builder.Configuration).ActivateMongo();
. - Add
app.UseTurbolineDashboard().ActivateMongo();
.
- Add namespace using
- Update the application settings with the following configurations:
- Set MongoDB as the database type.
- Provide the connection string for the database.
- Add an API key obtained from the plan subscription from https://platform.turboline.ai.
- Set an app name and logo URL.
"NLQ2SQLSettings": {
"mongoDb": {
"ConnectionString": "<Connectionstring>",
"DatabaseName": "<DatabaseName>"
},
"APIKey": "",
"AppName": "Amtev Data Studio, Powered by Turboline",
"Logo": "https://cdn.turboline.ai/cdn/adminlte/dist/img/TLLogo.png"
}
- Run the project to complete the setup.
- To access the Turboline NLQ to MOngoDB, navigate
/Turboline/mongodb
.
Cautionary Notes
- Ensure correct installation of the MongoDB package from NuGet.
- Double-check the code additions in the program.cs file for accuracy.
- Securely store and manage the API key obtained from the subscription plan.
Tips for Efficiency
- Follow the steps sequentially to avoid missing any crucial configurations.
- Keep all necessary information and URLs handy for quick reference during setup.
- Test the integration thoroughly after completion to ensure functionality.
By following these steps, you can seamlessly integrate MongoDB Turboline Packages into your application within a few minutes.