Closed Mercy811 closed 2 years ago
Unset
ClearAll
When ClearAll(), I pass nil as value, and the encoding would be
ClearAll()
nil
"user_properties":{ "$unset":{"name":"-"} }
which in other SDKs it is
"user_properties":{ "$unset": "_" }
I did a test with the help of @yuhao900914 and it works. Also we checked the backend code which only searches the key $clearAll.
$clearAll
The reason to do that is because there are two data types of Identify.Properties
Identify.Properties
map[IdentityOp]string
map[IdentityOp]map[string]interface{}
If I use map[string]interface{}, I cannot add key:value pair to interface type for other operations, for example:
map[string]interface{}
properties[operation][property] = value
So here I use map[string]map[string]interface{} and pass nil as value when ClearAll()
map[string]map[string]interface{}
Summary
Unset
andClearAll
operationsWhen
ClearAll()
, I passnil
as value, and the encoding would bewhich in other SDKs it is
I did a test with the help of @yuhao900914 and it works. Also we checked the backend code which only searches the key
$clearAll
.The reason to do that is because there are two data types of
Identify.Properties
map[IdentityOp]string
for$clearAll
operationmap[IdentityOp]map[string]interface{}
for the rest operationsIf I use
map[string]interface{}
, I cannot add key:value pair to interface type for other operations, for example:So here I use
map[string]map[string]interface{}
and passnil
as value whenClearAll()
Checklist