FIRQuery+Internal.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FIRQuery.h"
  17. @class FSTQuery;
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** Internal FIRQuery API we don't want exposed in our public header files. */
  20. @interface FIRQuery (Internal)
  21. + (FIRQuery *)referenceWithQuery:(FSTQuery *)query firestore:(FIRFirestore *)firestore;
  22. @property(nonatomic, strong, readonly) FSTQuery *query;
  23. @end
  24. // TODO(array-features): Move to FIRQuery.h once backend support is available.
  25. @interface FIRQuery ()
  26. /**
  27. * Creates and returns a new `FIRQuery` with the additional filter that documents must contain
  28. * the specified field, it must be an array, and the array must contain the provided value.
  29. *
  30. * A query can have only one arrayContains filter.
  31. *
  32. * @param field The name of the field containing an array to search
  33. * @param value The value that must be contained in the array
  34. *
  35. * @return The created `FIRQuery`.
  36. */
  37. // clang-format off
  38. - (FIRQuery *)queryWhereField:(NSString *)field
  39. arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:));
  40. // clang-format on
  41. /**
  42. * Creates and returns a new `FIRQuery` with the additional filter that documents must contain
  43. * the specified field, it must be an array, and the array must contain the provided value.
  44. *
  45. * A query can have only one arrayContains filter.
  46. *
  47. * @param path The path of the field containing an array to search
  48. * @param value The value that must be contained in the array
  49. *
  50. * @return The created `FIRQuery`.
  51. */
  52. // clang-format off
  53. - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path
  54. arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:));
  55. // clang-format on
  56. @end
  57. NS_ASSUME_NONNULL_END