beam.contains(). Changes made through the Datasets API apply to deployed pipelines immediately, with no redeploy.
Use a dataset when a list is large, changes often, or is shared across pipelines. For a list used by a single filter, a set filter is simpler.
Use beam.contains() in a transform
In a JavaScript (v8) transform, call beam.contains() with a dataset name and an array of values from the current record. It returns true if any value is in the dataset.
Lookups are exact and case-sensitive:
0xAbC and 0xabc are different values. Store values in the same case as your records, or normalize both sides in your transform.Example: keep transfers that involve a watchlisted wallet
Example: tag records sent to a known contract
Typical workflow
1
Create the dataset
Call Create dataset with a unique name. The response includes the
id used by ID-based endpoints.2
Populate it
Load values with Add entries or Add entries by name. Each request accepts up to 250,000 values. Split larger uploads into chunks and send at most 5 requests concurrently.
3
Reference it from a transform
Call
beam.contains("DATASET_NAME", [...]) in a JavaScript transform, then deploy the pipeline.4
Update membership live
Add or remove values with Add entries and Remove entries at any time. Running pipelines see changes immediately, with no redeploy.
Endpoints
Create dataset
Create a dataset.
List datasets
List your datasets.
Delete dataset
Delete a dataset and all of its entries.
Add entries
Add values to a dataset by ID.
Add entries by name
Add values to a dataset by name.
List entries
Paginate through a dataset’s values.
Remove entries
Remove specific values from a dataset.
Check entry
Check whether a value exists in a dataset.
Datasets vs. filter values
Both provide fast membership lookups. They differ in where you use them:
See Filter values for set filters.