diff options
author | zxu <zxu@google.com> | 2017-12-07 15:36:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-07 15:36:15 -0500 |
commit | 5da88e4b9b5ce9d1aee8611d03946e19bdfa5b65 (patch) | |
tree | 605cd2710e22d4ae8ab3c2bdfef33c996fd2244f /Firestore/Source/Public | |
parent | a904be723a997ed434a36ce9562794a75673927e (diff) |
Implement NSPredicate-based query (#531)
* implement queryFilteredUsingPredicate in FIRQuery;
* add unit test and integration test for queryFilteredUsingPredicate;
* project change of adding the FIRQueryTests.m file;
* refactoring queryFilteredUsingPredicate to split logic into two helpers;
Diffstat (limited to 'Firestore/Source/Public')
-rw-r--r-- | Firestore/Source/Public/FIRQuery.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Firestore/Source/Public/FIRQuery.h b/Firestore/Source/Public/FIRQuery.h index 0f3aeed..ff15ac6 100644 --- a/Firestore/Source/Public/FIRQuery.h +++ b/Firestore/Source/Public/FIRQuery.h @@ -256,6 +256,19 @@ NS_SWIFT_NAME(Query) isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); // clang-format on +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * satisfy the specified predicate. + * + * @param predicate The predicate the document must satisfy. Can be either comparison + * or compound of comparison. In particular, block-based predicate is not supported. + * + * @return The created `FIRQuery`. + */ +// clang-format off +- (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate NS_SWIFT_NAME(filter(using:)); +// clang-format on + #pragma mark - Sorting Data /** * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. |