@@ -164,7 +164,6 @@ Removes GroupMultiple to this object
164164 */
165165- (void )removeGroupMultiple : (BuiltGroupMultiple*)group ;
166166
167-
168167// MARK: - set values for reference fields
169168
170169/* *---------------------------------------------------------------------------------------
@@ -173,73 +172,73 @@ Removes GroupMultiple to this object
173172 */
174173
175174/* *
176- Assigns a set references to a reference field of an object.
175+ Assigns a set references to a reference field of an object.
177176
178- //Obj-C
179- BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
180- // setting the project reference
181- [detailGroup setReference:@"bltb6202sample73a1" forKey:@"project"];
182-
183- //Swift
184- var detailGroup:BuiltGroup = BuiltGroup(fieldName:"details")
185- // setting the project reference
186- detailGroup.setReference("bltb6202sample73a1", forKey:"project")
187-
188-
189- @param reference This can either be a UID of a referenced object or array of UIDs of a referenced objects.
190- @param key The uid of the reference field
177+ //Obj-C
178+ BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
179+ // setting the project reference
180+ [detailGroup setReference:@"bltb6202sample73a1" forKey:@"project"];
181+
182+ //Swift
183+ var detailGroup:BuiltGroup = BuiltGroup(fieldName:"details")
184+ // setting the project reference
185+ detailGroup.setReference("bltb6202sample73a1", forKey:"project")
186+
187+
188+ @param reference This can either be a UID of a referenced object or array of UIDs of a referenced objects.
189+ @param key The uid of the reference field
191190 */
192191- (void )setReference : (id )reference forKey : (NSString *)key ;
193192
194193/* *
195- Fires a query on Built.io Backend and all the objects which pass the query condition are being assigned to the reference field.
196-
197- //Obj-C
198- BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
199- // setting the project reference
200- [detailGroup setReferenceWhere:@{@"name":@"Super Project #41!"} forKey:@"project"];
194+ Fires a query on Built.io Backend and all the objects which pass the query condition are being assigned to the reference field.
201195
202- //Swift
203- var detailGroup:BuiltGroup = BuiltGroup(fieldName: "details")
204- // setting the project reference
205- detailGroup. setReferenceWhere([ "name":"Super Project #41!"], forKey:"project")
196+ //Obj-C
197+ BuiltGroup * detailGroup = [ BuiltGroup groupWithFieldName:@ "details"];
198+ // setting the project reference
199+ [ detailGroup setReferenceWhere:@{@ "name":@ "Super Project #41!"} forKey:@ "project"];
206200
207- @param dictionary Object specifying the conditions
208- @param key The uid of the reference field
201+ //Swift
202+ var detailGroup:BuiltGroup = BuiltGroup(fieldName:"details")
203+ // setting the project reference
204+ detailGroup.setReferenceWhere(["name":"Super Project #41!"], forKey:"project")
205+
206+ @param dictionary Object specifying the conditions
207+ @param key The uid of the reference field
209208 */
210209- (void )setReferenceWhere : (NSDictionary *)dictionary forKey : (NSString *)key ;
211210
212211/* *
213- Assigns a set references to a reference field of an object.
212+ Assigns a set references to a reference field of an object.
214213
215- //Obj-C
216- BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
217- BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
218- BuiltObject *projectObject = [projectClass object];
219- projectObject[@"name"] = @"Super Project #41!";
220-
221- BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
222- // setting the project reference
223- [detailGroup setReferenceWithObject:projectObject forKey:@"project"];
224-
225-
226- //Swift
227- var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
228- var projectClass:BuiltClass = builtApplication.classWithUID("project")
229- var projectObject:BuiltObject = projectClass.object()
230- projectObject["name"] = "Super Project #41!"
231-
232- var detailGroup:BuiltGroup = BuiltGroup(fieldName:"details")
233- // setting the project reference
234- detailGroup.setReferenceWithObject(projectObject, forKey:"project")
214+ //Obj-C
215+ BuiltApplication *builtApplication = [Built applicationWithAPIKey:@"blt5d4sample2633b"];
216+ BuiltClass *projectClass = [builtApplication classWithUID:@"project"];
217+ BuiltObject *projectObject = [projectClass object];
218+ projectObject[@"name"] = @"Super Project #41!";
219+
220+ BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
221+ // setting the project reference
222+ [detailGroup setReferenceWithObject:projectObject forKey:@"project"];
223+
224+
225+ //Swift
226+ var builtApplication:BuiltApplication = Built.applicationWithAPIKey("blt5d4sample2633b")
227+ var projectClass:BuiltClass = builtApplication.classWithUID("project")
228+ var projectObject:BuiltObject = projectClass.object()
229+ projectObject["name"] = "Super Project #41!"
230+
231+ var detailGroup:BuiltGroup = BuiltGroup(fieldName:"details")
232+ // setting the project reference
233+ detailGroup.setReferenceWithObject(projectObject, forKey:"project")
235234
236- @param referenceObject This can either an instance of BuiltObject or array of BuiltObject instance.
237- @param key The uid of the reference field
235+ @param referenceObject This can either an instance of BuiltObject or array of BuiltObject instance.
236+ @param key The uid of the reference field
238237 */
239238- (void )setReferenceWithObject : (id )referenceObject forKey : (NSString *)key ;
240239
241240/* *
242- Use this method only when the values of the fields inside referenced object are to be changed while creating a new object.
241+ Use this method only when the values of the fields inside referenced object is to be changed while creating a new object.
243242
244243 //ObjC
245244 BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
@@ -256,8 +255,30 @@ Use this method only when the values of the fields inside referenced object are
256255@param conditionDictionary A check will be performed, whether any object has the key value pair(s) supplied in the dictionary in the reference field
257256@param replaceDictionary New key value pairs for the fields inside the referenced object
258257 */
258+
259259- (void )addUpsertForReferenceField : (NSString *)referenceField condition : (NSDictionary *)conditionDictionary replaceWith : (NSDictionary *)replaceDictionary ;
260260
261+ /* *
262+ Use this method only when the values of the fields inside referenced objects are to be changed while creating a new object.
263+
264+ //ObjC
265+ BuiltGroup *detailGroup = [BuiltGroup groupWithFieldName:@"details"];
266+
267+ [detailGroup addUpsertForMultipleReferenceField:@"project" condition:@{@"name":@"Super Project #41"} replaceWith:@{@"name":@"Super Project A", @"description":@"New project"}];
268+
269+ //Swift
270+ var detailGroup:BuiltGroup = BuiltGroup(fieldName:"details")
271+
272+ detailGroup.addUpsertForMultipleReferenceField("project", condition:["name":"Super Project #41"], replaceWith:["name":"Super Project A", "description":"New project"])
273+
274+
275+ @param referenceField Reference uid on which UPSERT is to be performed
276+ @param conditionDictionary A check will be performed, whether any object has the key value pair(s) supplied in the dictionary in the reference field
277+ @param replaceDictionary New key value pairs for the fields inside the referenced object
278+ */
279+
280+ - (void )addUpsertForMultipleReferenceField : (NSString *)referenceField condition : (NSDictionary *)conditionDictionary replaceWith : (NSDictionary *)replaceDictionary ;
281+
261282
262283// MARK: - operations on fields of multiple type
263284
0 commit comments