Firestore with MongoDB Compatibility: Current State, Limitations, and Opportunities
In the ever-evolving landscape of NoSQL databases, Google Cloud has made a significant move by introducing MongoDB compatibility to its…

In the ever-evolving landscape of NoSQL databases, Google Cloud has made a significant move by introducing MongoDB compatibility to its Firestore database. Launched on April 9, 2025, this feature promises to bridge the gap between two popular database systems, offering developers the best of both worlds. Learn more about the announcement. But what exactly does this mean, and how can it impact your development projects? In this post, we’ll dive deep into the current state of Firestore with MongoDB compatibility, explore its key features and limitations, and discuss potential use cases that could benefit from this innovative integration.
Current State
Currently, Firestore with MongoDB compatibility is available in preview as part of the Firestore Enterprise edition. Understand what preview means. This means it’s accessible for testing and development, but it may not yet be suitable for production workloads without careful evaluation. Developers can start experimenting with it at no upfront cost, thanks to Firestore’s free tier, but should be aware that features and behaviors might change before the general availability release.
Key Features
One of the standout features is the ability to use standard MongoDB drivers — such as those for Java, Node.js, Python, Go, C#, and Ruby — to interact with Firestore. This compatibility extends to the MongoDB Query Language (MQL), allowing developers to write queries in a syntax they’re already comfortable with. Under the hood, Firestore handles the heavy lifting, providing its renowned scalability, real-time synchronization, and offline capabilities.
For example, connecting to Firestore using a MongoDB driver is straightforward. Here’s a snippet in Node.js:
const { MongoClient } = require('mongodb');
const uri = 'mongodb+srv://<project-id>:<api-key>@<cluster-name>.gcp.mongodb.net';
const client = new MongoClient(uri);
await client.connect();
const database = client.db('mydatabase');
const collection = database.collection('mycollection');
const result = await collection.find({}).toArray();
This code looks identical to what you’d write for a MongoDB database, but it’s actually communicating with Firestore.
To better understand how these features work in practice, watch this Google Cloud event video
Limitations
Despite its promise, Firestore with MongoDB compatibility comes with several limitations, particularly given its preview status. Here are some key areas where it falls short of full MongoDB functionality:
Unsupported Data Types
Certain MongoDB-specific BSON types, such as DBPointer, JavaScript, and Symbol, are not supported. Applications relying on these types will need to adjust their data models.
Query and Update Operators
While many query operators are available, advanced ones like $text
for text search and $where
for JavaScript-based queries are missing. Similarly, array manipulation operators like $push
and $pull
are not yet implemented, though Google has indicated they are coming soon.
Aggregation Pipeline
Only a subset of MongoDB’s aggregation operators is supported, limiting complex data processing capabilities. For instance, stages like $lookup
and $merge
are not available.
Geospatial Features
Currently, there is no support for geospatial queries, which could be a dealbreaker for location-based applications.
Interoperability with Native Firestore
Full integration with Firestore’s native real-time and offline features is not yet available when using the MongoDB compatibility layer. Developers may need to choose between the two interfaces for now, although Google plans to improve this integration.
Additionally, since the underlying database is Firestore, there might be differences in indexing and performance characteristics that developers need to account for.
For a detailed list of supported and unsupported features, refer to the official documentation.
Use Cases
This feature is particularly beneficial for:
- MongoDB Users Migrating to Google Cloud: Organizations can move their applications to Firestore with minimal code changes, leveraging Google Cloud’s infrastructure.
- New Applications Requiring Real-Time Features: Developers can build applications that benefit from Firestore’s real-time synchronization while using familiar MongoDB syntax.
- Hybrid Workloads: Once full interoperability is supported, applications can mix and match native Firestore features with MongoDB-compatible queries for maximum flexibility.
Future Developments
Google Cloud is actively working on enhancing this feature. Plans include adding support for more MongoDB operators, improving aggregation capabilities, and enabling better integration with Firestore’s native SDKs. Developers are encouraged to test the preview and provide feedback to help shape the future of this compatibility layer. Stay informed about updates.
Conclusion
Firestore with MongoDB compatibility represents a significant step forward in making Google Cloud’s database offerings more accessible to a broader range of developers. While it has some limitations in its current preview state, the potential for simplifying migrations and enabling hybrid database architectures is immense. If you’re a developer with MongoDB experience or looking to leverage Firestore’s capabilities without a steep learning curve, this feature is worth exploring. Stay tuned for updates as it moves towards general availability.
Comments ()