From 5da88e4b9b5ce9d1aee8611d03946e19bdfa5b65 Mon Sep 17 00:00:00 2001 From: zxu Date: Thu, 7 Dec 2017 15:36:15 -0500 Subject: 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; --- Firestore/Source/Public/FIRQuery.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Firestore/Source/Public') 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. -- cgit v1.2.3