datastore/providers/chroma_datastore.py [71:86]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        )

    async def upsert(
        self, documents: List[Document], chunk_token_size: Optional[int] = None
    ) -> List[str]:
        """
        Takes in a list of documents and inserts them into the database. If an id already exists, the document is updated.
        Return a list of document ids.
        """

        chunks = get_document_chunks(documents, chunk_token_size)

        # Chroma has a true upsert, so we don't need to delete first
        return await self._upsert(chunks)

    async def _upsert(self, chunks: Dict[str, List[DocumentChunk]]) -> List[str]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



datastore/providers/mongodb_atlas_datastore.py [77:89]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        )

    async def upsert(
        self, documents: List[Document], chunk_token_size: Optional[int] = None
    ) -> List[str]:
        """
        Takes in a list of Documents, chunks them, and upserts the chunks into the database.
        Return a list the ids of the document chunks.
        """
        chunks = get_document_chunks(documents, chunk_token_size)
        return await self._upsert(chunks)

    async def _upsert(self, chunks: Dict[str, List[DocumentChunk]]) -> List[str]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



