flutterfire
flutterfire copied to clipboard
[cloud_firestore]: flutter cloud_firestore package is not working if i select a DB that has "Firestore with MongoDB compatibility"
Is there an existing issue for this?
- [x] I have searched the existing issues.
Which plugins are affected?
No response
Which platforms are affected?
No response
Description
I want to use the Firestore with MongoDB as my database. I was able to read/write data on server side using firestore nodejs Admin package. But in the client side (flutter app) when i try to read data using the cloud_firestore i get this error
"W/Firestore(30072): (26.0.0) [WatchStream]: (19e0c6d) Stream closed with status: Status{code=UNAVAILABLE, description=The service is temporarily unavailable., cause=null}. W/Firestore(30072): (26.0.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: Status{code=UNAVAILABLE, description=The service is temporarily unavailable., cause=null} W/Firestore(30072): This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend."
But if i switch to a standard firestore DB then there's no error.
Reproducing the issue
I created a flutter app that uses "Firestore with MongoDB compatibility". Then i tried to read data from Firestore DB that has MongoDB compatibility.
import 'package:cloud_firestore/cloud_firestore.dart' as f;
FirebaseApp app = await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, );
f.FirebaseFirestore firestore = f.FirebaseFirestore.instanceFor(app: app, databaseId: 'mongodb');
Firebase Core version
^4.1.0
Flutter Version
Flutter 3.22.2
Relevant Log Output
W/Firestore(30072): (26.0.0) [WatchStream]: (19e0c6d) Stream closed with status: Status{code=UNAVAILABLE, description=The service is temporarily unavailable., cause=null}.
W/Firestore(30072): (26.0.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: Status{code=UNAVAILABLE, description=The service is temporarily unavailable., cause=null}
W/Firestore(30072): This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response