Skip to main content

๐Ÿ‘ Ingest data into MongoDB

The final step to build a MongoDB vector store for the chatbot is to ingest the embedded article chunks into MongoDB.

Fill in any <CODE_BLOCK_N> placeholders and run the cells under the Step 5: Ingest data into MongoDB section in the notebook to ingest the embedded documents into MongoDB.

The answers for code blocks in this section are as follows:

CODE_BLOCK_5

Answer
collection.insert_many(embedded_docs)
๐Ÿฆน Visually verify that the data has been imported into the local MongoDB cluster.

Click the leaf icon in the left navigation bar of the IDE.

Ensure that you see a database called mongodb_genai_devday_rag, and a collection named knowledge_base under it.

Verify collection

Click the > arrow next to knowledge_base and note the number of documents.

Verify document count

To preview a document, click the > arrow next to Documents and select a document from the list.

Preview document