Supported MongoDB data types and drivers

Relevant to Cloud Firestore Enterprise edition only.

The following tables list supported MongoDB data types, drivers, and third-party tools for Cloud 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 _id must not exceed 1500 bytes.

Other BSON types are not supported.

Languages and MongoDB drivers

Cloud 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)

Third-party tools

Cloud Firestore with MongoDB compatibility supports third-party tools described in this section.

Tool Description
mongoimport MongoDB Database Tools
mongoexport MongoDB Database Tools
mongodump MongoDB Database Tools
mongorestore MongoDB Database Tools
mongosh MongoDB Shell
Mongoose MongoDB object modeling tool
MongoDB Compass GUI tool for data exploration

What's next