Install and import from the "@langchain/mongodb" integration package instead.

const chatHistory = new MongoDBChatMessageHistory({
collection: myCollection,
sessionId: 'unique-session-id',
});
const messages = await chatHistory.getMessages();
await chatHistory.clear();

Hierarchy (view full)

Constructors

Methods

""