def test_delete_doc(self) -> None:
        """Test delete document from Couchbase vector store."""
        storage_context = StorageContext.from_defaults(vector_store=self.vector_store)

        # Add nodes to the couchbase vector
        VectorStoreIndex.from_documents(
            [
                Document(
                    text="hello",
                    metadata={"name": "John Doe", "age": 30, "city": "New"},
                ),
            ],
            storage_context=storage_context,
        )

        # Wait for the documents to be indexed
        time.sleep(SLEEP_DURATION)

        # similarity search
        search_embedding = OpenAIEmbedding().get_text_embedding("hello")
        q = VectorStoreQuery(
            query_embedding=search_embedding,
            similarity_top_k=1,
        )

        result = self.vector_store.query(q)
        assert result.nodes is not None and len(result.nodes) == 1

        # Identify the document to delete
        ref_id_to_delete = result.nodes[0].ref_doc_id

        # Delete the document
        self.vector_store.delete(ref_doc_id=ref_id_to_delete)

        # Wait for the documents to be indexed
        time.sleep(SLEEP_DURATION)

        # Ensure that no results are returned
        result = self.vector_store.query(q)
        assert len(result.nodes) == 0
Test delete document from Couchbase vector store.
llama-index-integrations/vector_stores/llama-index-vector-stores-couchbase/tests/test_vector_stores_couchbase.py