This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for update and merge writes (#298)
- Loading branch information
1 parent
dd45c33
commit 2b89c20
Showing
8 changed files
with
142 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2017, the Chromium project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
part of cloud_firestore; | ||
|
||
/// An options object that configures the behavior of [setData()] calls. | ||
/// | ||
/// By providing the [SetOptions] objects returned by [merge], the [setData()] | ||
/// calls on [DocumentReference] can be configured to perform granular merges | ||
/// instead of overwriting the target documents in their entirety. | ||
class SetOptions { | ||
const SetOptions._(this._data); | ||
final Map<String, dynamic> _data; | ||
|
||
/// Changes the behavior of set() calls to only replace the values specified | ||
/// in its data argument. | ||
static const SetOptions merge = const SetOptions._( | ||
const <String, dynamic>{'merge': true}, | ||
); | ||
|
||
// TODO(jackson): The Android Firestore SDK supports `mergeFieldPaths` and | ||
// `mergeFields`, but these options don't seem to be available yet on iOS. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters