I'm here to help you with the docs.
The MongoDB offline store provides support for reading MongoDBSource.
In order to use this offline store, you'll need to run pip install 'feast[mongodb]'.
The full set of configuration options is available in MongoDBOfflineStoreConfig.
The offline store uses a single shared collection (by default feature_history) that stores append-only historical feature rows for all feature views. Each document represents one observation of one entity for one FeatureView at a specific event timestamp:
Key properties:
Append-only: Historical data is treated as immutable; corrections are written as new rows with newer created_at timestamps rather than in-place updates.
Time-series friendly: event_timestamp represents when the feature value was observed; created_at is used as a tie-breaker when multiple observations share the same event timestamp.
Feature grouping by FeatureView: feature_view identifies which FeatureView the row belongs to, so a single collection can host multiple FVs.
A single compound index supports all major query patterns:
This index enables efficient range scans over entities and feature views, while ensuring that the most recent observation per (entity_id, feature_view) is seen first during aggregation. The index is created lazily on first use and cached per connection string.
Scoring vs. training paths: When each entity appears only once in entity_df (scoring/inference — one feature lookup per entity), server-side $group $first efficiently returns the single latest value per entity. When the same entity appears at multiple timestamps (training — building a dataset with many historical snapshots per entity), the store retrieves all candidate rows and uses pd.merge_asof to select the correct point-in-time value for each request timestamp.
Two-level chunking: CHUNK_SIZE (50,000 rows) controls the size of intermediate DataFrames in memory; MONGO_BATCH_SIZE (10,000 entity IDs) limits the query size sent to MongoDB.
The set of functionality supported by offline stores is described in detail here. Below is a matrix indicating which functionality is supported by the MongoDB offline store.
get_historical_features (point-in-time correct join)
yes
pull_latest_from_table_or_query (retrieve latest feature values)
yes
pull_all_from_table_or_query (retrieve a saved dataset)
yes
offline_write_batch (persist dataframes to offline store)
yes
write_logged_features (persist logged features to offline store)
no
Below is a matrix indicating which functionality is supported by MongoDBRetrievalJob.
export to dataframe
yes
export to arrow table
yes
export to arrow batches
no
export to SQL
no
export to data lake (S3, GCS, etc.)
no
export to data warehouse
no
export as Spark dataframe
no
local execution of Python-based on-demand transforms
yes
remote execution of Python-based on-demand transforms
no
persist results in the offline store
yes
preview the query plan before execution
no
read partitioned data
no
To compare this set of functionality against other offline stores, please see the full functionality matrix.
Last updated 22 days ago
Was this helpful?
Was this helpful?