Supported data types Stay organized with collections Save and categorize content based on your preferences.
This page describes the data types thatCloud Firestore supports.
Data types
The following table lists the data types supported byCloud Firestore. Italso describes the sort order used when comparing values of the same type:
| Data type | Sort order | Notes |
|---|---|---|
| Array | By element values | An array cannot contain another array value as one of its elements. Within an array, elements maintain the position assigned to them. When sorting two or more arrays, arrays are ordered based on their element values. When comparing two arrays, the first elements of each array are compared. If the first elements are equal, then the second elements are compared and so on until a difference is found. If an array runs out of elements to compare but is equal up to that point, then the shorter array is ordered before the longer array. For example, |
| Boolean | false <true | — |
| Bytes | Byte order | Up to 1,048,487 bytes (1 MiB - 89 bytes). Only the first 1,500 bytes areconsidered by queries. |
| Date and time | Chronological | When stored inCloud Firestore, precise only to microseconds; anyadditional precision is rounded down. |
| Floating-point number | Numeric | 64-bit double precision according toIEEE 754, including (normalized)NaN &+/-Infinity. |
| Geographical point | By latitude, then longitude | At this time we do not recommend using this data type due to querying limitations. It is generally better to store latitude and longitude as separate numeric fields. If your app needs simple distance-based geoqueries, seeGeo queries |
| Integer | Numeric | 64-bit, signed |
| Map | By keys, then by value | Represents an object embedded within a document. When indexed, you can queryon subfields. If you exclude this value from indexing, then all subfields are also excluded from indexing. Key ordering is always sorted. For example, if you write Map fields are sorted by key and compared by key-value pairs, first comparing the keys and then the values. If the first key-value pairs are equal, the next key-value pairs are compared, and so on. If two maps have all of the same key-value pairs, then map length is considered. For example, the following maps are in ascending order:
|
| 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 theUTF-8 representation are considered by queries. |
| Vector | By dimension and then by individual element values | The max supported embedding dimension is 2048. To store vectors with larger dimensions, usedimensionality reduction. |
Value type ordering
When a query involves a field with values of mixed types,Cloud Firestore uses a deterministic ordering based on the internalrepresentations. 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
- Vector embeddings
- Map values
Numeric ordering
Cloud Firestore sorts all numeric values (Integer &Floating point)interleaved with each other. Floating point comparison follows the totalordering ofIEEE 754 with the notableexception being thatCloud Firestore normalizes allNaN values, andconsiders it less than-Infinity.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.