def collection(
    vector_store: MongoDBAtlasVectorSearch, text_nodes: List[TextNode]
) -> Collection:
    """Depending on uri, this could point to any type of cluster."""
    clxn = vector_store.collection
    if clxn.count_documents({}) != len(text_nodes):
        clxn.delete_many({})
        vector_store.add(text_nodes)
    assert clxn.count_documents({}) == len(text_nodes)
    return clxn
Depending on uri, this could point to any type of cluster.
llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb/tests/test_filters.py