The flagship ergonomic surface (dataframes.py): cf.data.collection(ref) holding (client, collection).
read(where=, fields=, limit=) -> DataFrame; where/fields/limit are client-side sugar compiled to a $match/$project/$limit pipeline over AggregateStream (the API never sees these kwargs). Kwarg is where=, never query= — a Query is the saved server-side entity
fetch(...) -> ReadResult (iteration + to_pandas(); read() == fetch().to_pandas()). ReadResult is the seam future to_polars()/to_arrow()/__arrow_c_stream__ land on — batch-wise internals, one batch per gRPC chunk
iter_batches(batch_size=) streaming, memory-bounded
aggregate(pipeline) — caller-supplied pipeline, passed through untouched (Elastic-backed collections use this; the sugar emits Mongo syntax only)
- Writes:
append(df) (InsertMany bidi, chunked, progress callback), update(df, on="_id") (UpdateMany), upsert(df, on=key) (SyncManyByField), replace_where(filter, set_values) (UpdateManyByQuery), delete(where=|oids=), clear()
- Round-trip contract:
read() keeps _id as a regular column so update(df) just works
The flagship ergonomic surface (
dataframes.py):cf.data.collection(ref)holding (client, collection).read(where=, fields=, limit=)-> DataFrame;where/fields/limitare client-side sugar compiled to a$match/$project/$limitpipeline overAggregateStream(the API never sees these kwargs). Kwarg iswhere=, neverquery=— a Query is the saved server-side entityfetch(...)->ReadResult(iteration +to_pandas();read() == fetch().to_pandas()). ReadResult is the seam futureto_polars()/to_arrow()/__arrow_c_stream__land on — batch-wise internals, one batch per gRPC chunkiter_batches(batch_size=)streaming, memory-boundedaggregate(pipeline)— caller-supplied pipeline, passed through untouched (Elastic-backed collections use this; the sugar emits Mongo syntax only)append(df)(InsertMany bidi, chunked, progress callback),update(df, on="_id")(UpdateMany),upsert(df, on=key)(SyncManyByField),replace_where(filter, set_values)(UpdateManyByQuery),delete(where=|oids=),clear()read()keeps_idas a regular column soupdate(df)just works