Supported MongoDB data types and drivers
The following tables list supported MongoDB data types and drivers for Firestore with MongoDB compatibility.
Data types
| BSON Type | Supported |
|---|---|
| 32-bit Integer (int) | Yes |
| 64-bit Integer (long) | Yes |
| Array | Yes |
| Binary Data | Yes |
| Boolean | Yes |
| Date | Yes |
| DBPointer | No |
| DBRef | No |
| Decimal128 | Yes |
| Double | Yes |
| JavaScript | No |
| JavaScript (with scope) | No |
| MaxKey | Yes |
| MinKey | Yes |
| Null | Yes |
| Object | Yes |
| ObjectId | Yes |
| Regular Expression | Yes |
| String | Yes |
| Symbol | No |
| Timestamp | Yes |
| Undefined | No |
Document _id
The top-level _id field in a document must be one of the following types:
- ObjectId
- String
- 64-bit Integer (long)
- 32-bit Integer (int)
- Double
Binary
Binary data values used as the
_idmust not exceed 1500 bytes.
Other BSON types are not supported.
Languages and MongoDB drivers
Firestore with MongoDB compatibility supports the following driver versions:
| Language | Driver versions | Notes |
|---|---|---|
| Java | 5.x | OIDC authentication from Google Cloud available starting in 4.10 |
| Node.js | 6.x 5.x |
OIDC authentication from Google Cloud available starting in 6.7 |
| Python | 4.x 3.x (x ≥ 12) |
OIDC authentication from Google Cloud available starting in 4.7 |
| Go | 2.x | |
| C# | 3.x | |
| Ruby | 2.x (x ≥ 16) |
What's next
- Run the Quickstart: Create a database and connect to it.
- Learn about Behavior differences.
- For a breakdown of supported features depending on MongoDB version, see