Supported Data Types
This page describes the data types that Cloud Firestore supports.
Data types
Data type | Sort order | Notes |
---|---|---|
Array | None | Cannot contain another array value. |
Boolean | false < true |
— |
Bytes | Byte order | Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes are considered by queries. |
Date and time | Chronological | When stored in Cloud Firestore, precise only to microseconds; any additional precision is rounded down. |
Floating-point number | Numeric | 64-bit double precision, IEEE 754. |
Geographical point | By latitude, then longitude | — |
Integer | Numeric | 64-bit, signed |
Map | None | Represents an object embedded within a document. When indexed, you can query on subfields. If you exclude this value from indexing, then all subfields are also excluded from indexing. |
Null | None | — |
Reference | By path elements (collection, document ID, collection, document ID...) | For example,projects/[PROJECT_ID]/databases/[DATABASE_ID]/documents/[DOCUMENT_PATH] . |
Text string | UTF-8 encoded byte order | Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes of the UTF-8 representation are considered by queries. |
Value type ordering
When a query involves a field with values of mixed types, Cloud Firestore uses a deterministic ordering based on the internal representations. The following list shows the order:
- Null values
- Boolean values
- Integer and floating-point values, sorted in numerical order
- Date values
- Text string values
- Byte values
- Cloud Firestore references
- Geographical point values
- Array values
- Map values