File tree 1 file changed +14
-0
lines changed
ParseSwift.playground/Pages/13 - Operations.xcplaygroundpage 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 72
72
print ( error)
73
73
}
74
74
75
+ //: Query all scores who have a name.
76
+ let query1 = GameScore . query ( notNull ( key: " name " ) )
77
+ let results1 = try query1. find ( )
78
+ results1. forEach { score in
79
+ print ( " Found score with a name: \( score) " )
80
+ }
81
+
75
82
//: You can also remove a value for a property using unset.
76
83
let unsetOperation = savedScore
77
84
. operation. unset ( ( " points " , \. points) )
93
100
print ( error)
94
101
}
95
102
103
+ //: Query synchronously (not preferred - all operations on main queue).
104
+ let query2 = GameScore . query ( isNull ( key: " name " ) )
105
+ let results2 = try query2. find ( )
106
+ results2. forEach { score in
107
+ print ( " Found score with name is null: \( score) " )
108
+ }
109
+
96
110
//: There are other operations: set/forceSet/unset/add/remove, etc. objects from `ParseObject`s.
97
111
//: In fact, the `users` and `roles` relations from `ParseRoles` used the add/remove operations.
98
112
//: Multiple operations can be chained together. See:
You can’t perform that action at this time.
0 commit comments