FIRQuery+Internal.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. * @param field The name of the field containing an array to search
  31. * @param value The value that must be contained in the array
  32. *
  33. * @return The created `FIRQuery`.
  34. */
  35. // clang-format off
  36. - (FIRQuery *)queryWhereField:(NSString *)field
  37. arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:));
  38. // clang-format on
  39. /**
  40. * Creates and returns a new `FIRQuery` with the additional filter that documents must contain
  41. * the specified field, it must be an array, and the array must contain the provided value.
  42. *
  43. * @param path The path of the field containing an array to search
  44. * @param value The value that must be contained in the array
  45. *
  46. * @return The created `FIRQuery`.
  47. */
  48. // clang-format off
  49. - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path
  50. arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:));
  51. // clang-format on
  52. @end
  53. NS_ASSUME_NONNULL_END