Skip to main content
You are viewing help content for pre-release software. This document and the features it describes are subject to change.
All docs
V25.2
  • Create a MongoDB Data Source

    1. Install the MongoDB.Driver NuGet package.
    2. Register data connections in the application.json or Web.config file.

      {
        "AllowedHosts": "*",
        "ConnectionStrings": {
          "MongoDB (local)": "mongodb://localhost:27017/"
        }
      }
      

      Important

      For security reasons, the Web Dashboard control does not expose connection strings defined in appsettings.json or Web.config. If the configuration file contains connection strings, the control displays an error. Use a data connection string provider to pass connection parameters securely and prevent data leaks.

      You can use a predefined provider or implement a custom provider.

      using DevExpress.DataAccess.Web;
      // ...
      var builder = WebApplication.CreateBuilder(args);
      IConfiguration? configuration = builder.Configuration;
      
      services.AddScoped<DashboardConfigurator>((IServiceProvider serviceProvider) => {
          DashboardConfigurator configurator = new DashboardConfigurator();
          configurator.SetConnectionStringsProvider(new DashboardConnectionStringsProvider(configuration));
          return configurator;
      });
      

      See the following help topic for more information: ASP.NET Core Security Considerations.

    3. In the Dashboard Data Source Wizard, select MongoDB and click Next.

      Create a MongoDB Data Source - Web Dashboard, DevExpress

    4. Specify the data connection and click Next:

      MongoDB Connection - Web Dashboard, DevExpress

    5. Configure queries and click Next.

      MongoDB Queries - Web Dashboard, DevExpress

    6. Select data fields and click Finish.

      Select Data Fields - Web Dashboard, DevExpress

    API

    Page Name Page ID Class
    Choose Connection MongoDBDataSourceWizardPageId.ChooseMongoDBDataConnectionPage ChooseMongoDBDataConnectionPage
    Choose Schema MongoDBDataSourceWizardPageId.ChooseMongoDBSchemaPage ChooseMongoDBSchemaPage
    Choose Collections MongoDBDataSourceWizardPageId.ChooseMongoDBCollectionPage ChooseMongoDBCollectionPage
    See Also