aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Public/FIRQuery.h
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source/Public/FIRQuery.h')
-rw-r--r--Firestore/Source/Public/FIRQuery.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/Firestore/Source/Public/FIRQuery.h b/Firestore/Source/Public/FIRQuery.h
index a28af39..946cf06 100644
--- a/Firestore/Source/Public/FIRQuery.h
+++ b/Firestore/Source/Public/FIRQuery.h
@@ -16,6 +16,7 @@
#import <Foundation/Foundation.h>
+#import "FIRFirestoreSource.h"
#import "FIRListenerRegistration.h"
@class FIRFieldPath;
@@ -44,6 +45,11 @@ NS_SWIFT_NAME(Query)
/**
* Reads the documents matching this query.
*
+ * This method attempts to provide up-to-date data when possible by waiting for
+ * data from the server, but it may return cached data or fail if you are
+ * offline and the server cannot be reached. See the
+ * `getDocuments(source:completion:)` method to change this behavior.
+ *
* @param completion a block to execute once the documents have been successfully read.
* documentSet will be `nil` only if error is `non-nil`.
*/
@@ -51,6 +57,20 @@ NS_SWIFT_NAME(Query)
NS_SWIFT_NAME(getDocuments(completion:));
/**
+ * Reads the documents matching this query.
+ *
+ * @param source indicates whether the results should be fetched from the cache
+ * only (`Source.cache`), the server only (`Source.server`), or to attempt
+ * the server and fall back to the cache (`Source.default`).
+ * @param completion a block to execute once the documents have been successfully read.
+ * documentSet will be `nil` only if error is `non-nil`.
+ */
+// clang-format off
+- (void)getDocumentsWithSource:(FIRFirestoreSource)source completion:(FIRQuerySnapshotBlock)completion
+ NS_SWIFT_NAME(getDocuments(source:completion:));
+// clang-format on
+
+/**
* Attaches a listener for QuerySnapshot events.
*
* @param listener The listener to attach.