Export Chonkie’s Chunks into a MongoDB collection.
The MongoDBHandshake class provides integration between Chonkie’s chunking system and MongoDB, a popular NoSQL database.Embed and store your Chonkie chunks in MongoDB directly from the Chonkie SDK.
from chonkie import MongoDBHandshake, SemanticChunker # Initialize the handshakehandshake = MongoDBHandshake(uri="mongodb://localhost:27017", db_name="my_documents")# Create some chunkschunker = SemanticChunker()chunks = chunker.chunk("Chonkie loves to chonk your texts!")# Write chunks to MongoDBhandshake.write(chunks)