<@U04S8PLJWMT> I'm using this condition {{ record[...
# replication-ask-ai
c
@kapa.ai I'm using this condition {{ record["updated_at"]["$date"] >= stream_interval["start_time"] }} in record filter in rest_api creation , what should be the format so that this can be valid
k
Record Filter
conditions must be written as an interpolated string using Airbyte’s expression syntax, inside double curly braces
{{ }}
. Inside, you can use Python‑like expressions and the provided context variables (
record
,
stream_interval
, etc.). [[RecordFilter ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/RecordFilter); [Record filter UI](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/record-processing#record-filter)] Your expression:
Copy code
jinja {{ record["updated_at"]["$date"] >= stream_interval["start_time"] }}
is already in the correct syntactic format for a Record Filter, assuming: - Each record has a nested value like
{"updated_at": {"$date": "..."}}
-
stream_interval["start_time"]
is comparable (same type: both strings in the same datetime format, or both numeric timestamps, etc.) If you’re getting an error, the problem is usually type/format, not the expression syntax itself. Airbyte’s docs do not specify automatic parsing for complex/nested date formats inside filters; they only show examples where the compared values are already in a directly comparable format (e.g. flat
record['created_at']
vs
stream_interval['start_time']
). [[RecordFilter ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/RecordFilter)] Given the available documentation, there is no explicit support described for applying custom datetime parsing inside the Record Filter expression itself. If
record["updated_at"]["$date"]
is not already the same string format as
stream_interval["start_time"]
, you would need to normalize the cursor field earlier (e.g., via transformations / moving or reformatting the field) so that:
Copy code
jinja {{ record["updated_at"] >= stream_interval["start_time"] }}
compares two compatible values. So, from the docs: - Your overall format
{{ ... }}
is correct. - The inner expression must evaluate to a boolean and use only the provided variables. - The docs do not describe a way to specify a datetime format for this filter; you must ensure the actual field values are already comparable.
c
This is current format, should this work?
Copy code
"updated_at": {
          "$date": "2025-12-19T09:06:40.491Z"
        }
@kapa.ai
Copy code
"updated_at": {
          "$date": "2025-12-19T09:06:40.491Z"
        }
k
A message from kapa.ai
Given your record shape:
Copy code
json "updated_at": {   "$date": "2025-12-19T09:06:40.491Z" }
and your filter:
Copy code
jinja {{ record["updated_at"]["$date"] >= stream_interval["start_time"] }}
the expression format itself is valid for an Airbyte Record Filter: it’s an interpolated string with a boolean condition using
record
and
stream_interval
, which are documented as allowed variables. [[Record filter UI](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/record-processing#record-filter)] However, for this to work at runtime: 1.
record["updated_at"]["$date"]
must be a string in a datetime format that can be compared lexicographically with
stream_interval["start_time"]
(e.g. both ISO 8601 strings like
2025-12-19T09:06:40.491Z
), or both must already be in a comparable numeric/timestamp form. 2. The docs do not describe any way to specify a datetime parsing/format directly in the Record Filter itself, nor any special handling of the Mongo‑style
{"$date": ...}
wrapper; they only show simple comparisons such as:
Copy code
jinja    {{ record['created_at'] >= stream_interval['start_time'] }}
[[Record selector 1.6](https://docs.airbyte.com/platform/1.6/connector-development/config-based/understanding-the-yaml-file/record-selector); [Record filter UI](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/record-processing#record-filter)] So: - Syntax: keep your filter exactly like this (no extra formatting needed):
Copy code
jinja   {{ record["updated_at"]["$date"] >= stream_interval["start_time"] }}
- Data format requirement: ensure
stream_interval["start_time"]
is in the same ISO‑8601 string format as the
$date
value (e.g.
2025-12-19T09:06:40.491Z
), so that a simple
>=
string comparison behaves as intended. If those two sides are in different formats or types, the docs don’t provide a supported way to convert/parse them inside the filter expression; you’d need to adjust how the cursor or stream interval is produced so they match.