Skip to content

Commit 6c95686

Browse files
rommyarbth3brinkphillwigginsmregandla
authored
Added an example of how to update existing object values (#309)
* Fixed the Parse().initialize's return value (#307) * Release/1.0.26 - Update docs * Updated Live Queries related documentation (#301) * Fixed the parse initialize method Parse().initialize returns a new instantiation of the Parse class, but it should return the initialized instance. Co-authored-by: Phill Wiggins <[email protected]> Co-authored-by: mregandla <[email protected]> * Added example for update existing Object values Maybe need some correction. Thank you. Co-authored-by: James Brinkerhoff <[email protected]> Co-authored-by: Phill Wiggins <[email protected]> Co-authored-by: mregandla <[email protected]>
1 parent 8a5dddc commit 6c95686

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ var dietPlan = ParseObject('DietPlan')
5757
..set('Fat', 65);
5858
await dietPlan.save();
5959
```
60+
Or update existing object by its objectId by calling:
61+
```dart
62+
var dietPlan = ParseObject('DietPlan')
63+
..objectId = 'R5EonpUDWy'
64+
..set('Fat', 70);
65+
await dietPlan.save();
66+
```
6067
Verify that the object has been successfully saved using
6168
```dart
6269
var response = await dietPlan.save();

lib/parse_server_sdk.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Parse {
135135

136136
_hasBeenInitialized = true;
137137

138-
return Parse();
138+
return this;
139139
}
140140

141141
bool hasParseBeenInitialized() => _hasBeenInitialized;

0 commit comments

Comments
 (0)