File tree 1 file changed +24
-0
lines changed
Firestore/Example/Tests/Integration/API 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1180,4 +1180,28 @@ - (void)testOrderByEquality {
1180
1180
matchesResult: @[ @" doc6" , @" doc3" ]];
1181
1181
}
1182
1182
1183
+ - (void )resumingAQueryShouldUseExistenceFilterToDetectDeletes {
1184
+ // Prepare the names and contents of the 100 documents to create.
1185
+ NSMutableDictionary <NSString *, NSDictionary <NSString *, id >*>* testData = [[NSMutableDictionary alloc ] init ];
1186
+ for (int i=0 ; i<100 ; i++) {
1187
+ [testData setValue: @{@" key" : @42 } forKey: [NSString stringWithFormat: @" doc%@ " , @(i)]];
1188
+ }
1189
+
1190
+ // Create 100 documents in a new collection.
1191
+ FIRCollectionReference *collRef = [self collectionRefWithDocuments: testData];
1192
+
1193
+ // Run a query to populate the local cache with the 100 documents and a resume token.
1194
+ NSArray <FIRDocumentReference*>* createdDocuments;
1195
+ {
1196
+ FIRQuerySnapshot *querySnapshot = [self readDocumentSetForRef: collRef source: FIRFirestoreSourceDefault];
1197
+ NSMutableArray <FIRDocumentReference*>* createdDocumentsAccumulator = [[NSMutableArray alloc ] init ];
1198
+ for (FIRDocumentSnapshot* documentSnapshot in querySnapshot.documents ) {
1199
+ [createdDocumentsAccumulator addObject: documentSnapshot.reference];
1200
+ }
1201
+ createdDocuments = [createdDocumentsAccumulator copy ];
1202
+ }
1203
+
1204
+ (void )createdDocuments;
1205
+ }
1206
+
1183
1207
@end
You can’t perform that action at this time.
0 commit comments