Appearance
ema / @internals/db / MongoConversationMessageDB
Class: MongoConversationMessageDB
Defined in: db/mongo.conversation_message.ts:13
MongoDB-based implementation of ConversationMessageDB Stores conversation message data in a MongoDB collection
Implements
Constructors
Constructor
ts
new MongoConversationMessageDB(mongo): MongoConversationMessageDB;Defined in: db/mongo.conversation_message.ts:26
Creates a new MongoConversationMessageDB instance
Parameters
mongo
MongoDB instance to use for database operations
Returns
MongoConversationMessageDB
Properties
collections
ts
collections: string[];Defined in: db/mongo.conversation_message.ts:20
The collection names being accessed
Methods
addConversationMessage()
ts
addConversationMessage(entity): Promise<number>;Defined in: db/mongo.conversation_message.ts:78
Inserts a conversation message in the database
Parameters
entity
The conversation message to add
Returns
Promise<number>
Promise resolving to the ID of the created message
Implementation of
ConversationMessageDB.addConversationMessage
deleteConversationMessage()
ts
deleteConversationMessage(id): Promise<boolean>;Defined in: db/mongo.conversation_message.ts:92
Deletes a conversation message from the database
Parameters
id
number
The unique identifier for the conversation message to delete
Returns
Promise<boolean>
Promise resolving to true if deleted, false if not found
Implementation of
ConversationMessageDB.deleteConversationMessage
getConversationMessage()
ts
getConversationMessage(id): Promise<
| ConversationMessageEntity
| null>;Defined in: db/mongo.conversation_message.ts:58
Gets a specific conversation message by ID
Parameters
id
number
The unique identifier for the conversation message
Returns
Promise< | ConversationMessageEntity | null>
Promise resolving to the conversation message data or null if not found
Implementation of
ConversationMessageDB.getConversationMessage
listConversationMessages()
ts
listConversationMessages(req): Promise<ConversationMessageEntity[]>;Defined in: db/mongo.conversation_message.ts:35
Lists conversation messages in the database
Parameters
req
ListConversationMessagesRequest
The request to list conversation messages
Returns
Promise<ConversationMessageEntity[]>
Promise resolving to an array of conversation message data