@@ -44,9 +44,9 @@ It's possible to add other parameters to work with your instance of Parse Server
4444 clientKey: keyParseClientKey, // Required for some setups
4545 debug: true, // When enabled, prints logs to console
4646 liveQueryUrl: keyLiveQueryUrl, // Required if using LiveQuery
47- autoSendSessionId: true, // Some confurations require this to be true
47+ autoSendSessionId: true, // Required for authentication and ACL
4848 securityContext: securityContext, // Again, required for some setups
49- coreStore: await CoreStoreSharedPrefsImp.getInstance()); // Will use SharedPreferences instead of Sembast as an internal DB
49+ coreStore: await CoreStoreSharedPrefsImp.getInstance()); // Local data storage method. Will use SharedPreferences instead of Sembast as an internal DB
5050```
5151
5252## Objects
@@ -133,6 +133,17 @@ and to retrieve it
133133var dietPlan = DietPlan().fromPin('OBJECT ID OF OBJECT');
134134```
135135
136+ ## Storage
137+ We now have 2 types of storage, secure and unsecure. We currently rely on 2 third party options:
138+
139+ - SharedPreferences
140+ - Sembast
141+ Sembast offers secured storage, whilst SharePreferences wraps NSUserDefaults (on iOS) and SharedPreferences (on Android).
142+
143+ The storage method is defined in the parameter __ coreStore__ in Parse().initialize
144+
145+ Check sample code for options
146+
136147## Increment Counter values in objects
137148Retrieve it, call
138149
@@ -578,6 +589,40 @@ final Map<String, String> params = <String, String>{'plan': 'paid'};
578589function.execute(parameters: params);
579590```
580591
592+ ## Relation
593+
594+ The SDK supports Relation.
595+
596+ To add relation to object:
597+
598+ ``` dart
599+ dietPlan.addRelation('fruits', [ParseObject("Fruits")..set("objectId", "XGadzYxnac")]);
600+ ```
601+
602+ To remove relation to object:
603+
604+ ``` dart
605+ dietPlan.removeRelation('fruits', [ParseObject("Fruits")..set("objectId", "XGadzYxnac")]);
606+ ```
607+
608+ To Retrive a relation instance for user, call:
609+ ``` dart
610+ final relation = dietPlan.getRelation('fruits');
611+ ```
612+
613+ and then you can add a relation to the passed in object:
614+ ```
615+ relation.add(dietPlan);
616+ final result = await user.save();
617+ ```
618+
619+ To retrieve objects that are members of Relation field of a parent object:
620+ ``` dart
621+ QueryBuilder<ParseObject> query =
622+ QueryBuilder<ParseObject>(ParseObject('Fruits'))
623+ ..whereRelatedTo('fruits', 'DietPlan', DietPlan.objectId);
624+ ```
625+
581626## Other Features of this library
582627Main:
583628* Installation (View the example application)
0 commit comments