diff options
author | Michael Lehenbauer <mikelehen@gmail.com> | 2018-07-10 16:58:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 16:58:56 -0700 |
commit | 25f8691970a9f765a87ab3125776598c92e02744 (patch) | |
tree | efdef14fd22c313411b9125d4804fd59aa114d5e /Firestore/Source/Public/FIRFieldValue.h | |
parent | 6466c35737eff21e9b48c3ce2353d42628f4bb77 (diff) |
Expose array transforms and array contains queries. (#1514)
Also remove test code that was combining multiple array contains
queries since those were disallowed in
https://github.com/firebase/firebase-ios-sdk/commit/0ec836f9ca71b27fa54a11ae9e07e60b8c5cc002
Diffstat (limited to 'Firestore/Source/Public/FIRFieldValue.h')
-rw-r--r-- | Firestore/Source/Public/FIRFieldValue.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Firestore/Source/Public/FIRFieldValue.h b/Firestore/Source/Public/FIRFieldValue.h index 11a0da0..d896587 100644 --- a/Firestore/Source/Public/FIRFieldValue.h +++ b/Firestore/Source/Public/FIRFieldValue.h @@ -38,6 +38,29 @@ NS_SWIFT_NAME(FieldValue) */ + (instancetype)fieldValueForServerTimestamp NS_SWIFT_NAME(serverTimestamp()); +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * union the given elements with any array value that already exists on the server. Each + * specified element that doesn't already exist in the array will be added to the end. If the + * field being modified is not already an array it will be overwritten with an array containing + * exactly the specified elements. + * + * @param elements The elements to union into the array. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForArrayUnion:(NSArray<id> *)elements NS_SWIFT_NAME(arrayUnion(_:)); + +/** + * Returns a special value that can be used with setData() or updateData() that tells the server to + * remove the given elements from any array value that already exists on the server. All + * instances of each element specified will be removed from the array. If the field being + * modified is not already an array it will be overwritten with an empty array. + * + * @param elements The elements to remove from the array. + * @return The FieldValue sentinel for use in a call to setData() or updateData(). + */ ++ (instancetype)fieldValueForArrayRemove:(NSArray<id> *)elements NS_SWIFT_NAME(arrayRemove(_:)); + @end NS_ASSUME_NONNULL_END |