Comments (2)
Initial Attempt failed
Initial attempt that avoids modifying rootParent until updateData and setData failed.
suztomo@3ed76fe#diff-855d1299f8d5526ef0aacc2ddf24af06R28
This attempt fails to record subcollection whose parent is not saved.
cloud_firestore_mocks internally maintains documents as a tree using Map. When parent is not saved, getting collection reference creates a new map which does not have the subcolleciton.
This issue requires to save whether a document is stored in the instance or not. Maybe MockFirestoreInstance remembers all saved document location such as /users/t1gVCkBrgMU9LjFRnrtu1FFjlir1/persons/FkHWNY0ISMz9Zia0mF0q
and MockDocumentReference and MockCollectionReference remembers MockFirestoreInstance.
from fake_cloud_firestore.
Note. In real Firestore, creating a non-top-level document does not create its parent document. For example, creating users/abc/friends/{documentId}
does not create a document at users/abc
.
final firestore = Firestore.instance;
await firestore.collection('dummy').document('abc')
.collection('friends').document().setData(
<String, dynamic>{
'name': 'Tomo',
}
);
final abcSaved = await firestore.collection('dummy').document('abc').get();
if (abcSaved.exists) { // This is false.
print('$abcSaved');
}
from fake_cloud_firestore.
Related Issues (20)
- Support for flutter web HOT 1
- mergeFields ignored in mock "set" method HOT 2
- Batch failure is different compared to real firestore
- Transaction does not revert if an error occurs HOT 1
- Cannot throw exception on DocumentReference.get() call (#get) HOT 1
- Please update dependancies HOT 3
- Throwing exceptions with Queries do not work when using different references
- Collection.get does not support throwing Exceptions
- StreamSubscription<QuerySnapshot<Map<String, dynamic>>> fails to capture data if the query is filtered using .where(field, arrayContains: Map<String, String>)
- type 'MethodChannelFieldValue' is not a subtype of type 'MockFieldValuePlatform' in type cast HOT 1
- add option to dump/load database to/from file HOT 1
- Add support for `cloud_firestore: ^4.14.0` HOT 5
- Support for Firestore OR queries
- listeners not updating with #284 fix
- Error with type mismatch in Query.startAt
- throws null value with composite key query on null data document HOT 1
- Cannot use `whereIn` operator on map
- Stream is not updated when using map
- Add `pauseNetwork`, `unpauseNetwork`, `stopNetwork`
- Fix incompatibility with cloud_firestore 4.17.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fake_cloud_firestore.