def test_query_with_field_filter(
    vector_store: FirestoreVectorStore,
    test_case: TestCase,
) -> None:
    """Test querying the vector store with filters."""
    query_embedding = [1.0, 2.0, 3.0]
    query = VectorStoreQuery(
        query_embedding=query_embedding,
        filters=MetadataFilters(
            filters=[MetadataFilter(key="metadata.ref_doc_id", value="1234")]
        ),
    )
    collection_ref_with_filter = (
        vector_store.client.collection.return_value.where.return_value
    )

    vector_store.query(query)

    vector_store.client.collection.assert_called_with(TEST_COLLECTION)
    collection_ref_with_filter.find_nearest.assert_called_with(
        vector_field="embedding",
        query_vector=Vector(query_embedding),
        distance_measure=DistanceMeasure.COSINE,
        limit=1,
    )
    test_case.assertIsInstance(
        vector_store.client.collection.return_value.where.call_args_list[0][1][
            "filter"
        ],
        FieldFilter,
    )
Test querying the vector store with filters.
llama-index-integrations/vector_stores/llama-index-vector-stores-firestore/tests/test_firestore.py