Date fields¶
Date fields are strings in an ISO 8601 format:
{
"_id": 1,
"name": "KFC",
"date": "2024-01-01"
}
Internally dates are stored as integer fields with a day offset from the start of the epoch (1970-01-01).
Like date fields, datetime fields are also strings in an ISO 8601:
{
"_id": 1,
"name": "KFC",
"date": "2024-01-01T00:00:01Z"
}
datetime fields are stored as milliseconds till the UNIX epoch in the UTC timezone:
- Nixiesearch implicitly converts non-UTC
datetimefields into the UTC zone - Only the UTC-zoned
datetimefields are returned. You need to perform the timezone conversion on the application side.
date and datetime fields can be filtered and aggregated.
Example field schema for a datetime field updated_at:
schema:
movies:
fields:
title:
type: text
search: false
updated_at:
type: datetime
filter: true # field is filterable
facet: true # field is facetable