Seed MongoDB with Core Data

MongoDB must be initialized with seed data so that iMaintenance has its baseline configuration — roles, forms, dashboards, preferences, and integration templates. Without this step, the application will launch with missing or incomplete data.

To seed MangoDB with core data:
  1. Source Latest JSON Files
    • Location: RACE/backend/Seed Data/JSON

    • Retrieve the latest configuration, permission, integration, and form-related JSONs from devdb.

    • If configurations are not coming from SAP, include the default configuration for attachments and ensure Plant is added manually in the DB.

  2. Verify Required JSON Files
    • Integrations

    • SAP Inbound

    • AlertString

    • Configurations

    • Dashboard

    • Language (Usecase – Language)

    • MasterBo (Reports)

    • MasterForm, MasterFormPage, MasterFormPageSection, MasterFormPageSectionField, MasterFormPageSectionFieldLogic

    • MobileAppPreference

    • Permission

    • Report

    • RiskMatrix

    • Role

    • User

    • Widget, WidgetConfiguration

  3. Confirm Storage Locations
    • AWS S3 Bucket:race2.0resources

    • Drive Link:RACE2.0 SEED DATA (Google Drive folder)

  4. Update MongoDB Connection Configuration
    • File Path: RACE/backend/Seed Data/connection/mongo.js

    • Modify the nosql object with the appropriate values:

      • Database

      • Host (only if switching MongoDB clusters)

      • Username

      • Password

  5. Run Seed Script and wait for the process to complete.
    cd RACE/backend/Seed Data
    node index.js