/
MongoDB connection

MongoDB connection

MongoDB stores contact information, trancripts and multimedia messages. To troubleshoot an issue, sometimes is requested to connect directly to the DB to check store data. This page shows how you can do that using any compatible third party MongoDB clients.

 Instructions

To be able to connect to the mongoDB instance, you can use any available mongodb client.

Ones of the most use are:

  1. Provide the IP/hostname of your ctlive server

    image-20250228-080748.png
  2. In the authentication tab, provide admin as Database and username (userAdmin) and password (specified from .env file along with docker-compose.yaml)

    image-20250228-080908.png
  3. Once connected, you can view all the databases that have been created. The CTLiveMaster is utilized to store the credentials required for accessing the tenant database. The default tenant is referred to as ctlive, while all other tenants are displayed as ctlive_TENANTNAME.

  4. Each tenant DB has a set of collections, chatcontacts, chattranscripts, multimediatranscripts store contacts

To search for a contact use always the contactID. A tipical mondodb query is:
db.getCollection('chatcontacts').find({_id: "CHAT_AGM_1a9af578-2d17-401e-9d55-8e8d1df7e5af"})

To search instead for the last store contact:

db.getCollection('chatcontacts').find({}).sort({beginTime: -1})