You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Sets user's custom property value only if it was not set before
925
+
* @param {string} key - name of the property to attach to user
926
+
* @param {string|number} value - value to store under provided property
927
+
* */
928
+
set_once(key,value){
929
+
change_custom_property(key,value,"$setOnce");
930
+
},
931
+
/**
932
+
* Unset's/delete's user's custom property
933
+
* @param {string} key - name of the property to delete
934
+
* */
935
+
unset(key){
936
+
deleteuserProperties.custom[key];
937
+
},
938
+
/**
939
+
* Increment value under the key of this user's custom properties by one
940
+
* @param {string} key - name of the property to attach to user
941
+
* */
942
+
increment(key){
943
+
change_custom_property(key,1,"$inc");
944
+
},
945
+
/**
946
+
* Increment value under the key of this user's custom properties by provided value
947
+
* @param {string} key - name of the property to attach to user
948
+
* @param {number} value - value by which to increment server value
949
+
* */
950
+
increment_by(key,value){
951
+
change_custom_property(key,value,"$inc");
952
+
},
953
+
/**
954
+
* Multiply value under the key of this user's custom properties by provided value
955
+
* @param {string} key - name of the property to attach to user
956
+
* @param {number} value - value by which to multiply server value
957
+
* */
958
+
multiply(key,value){
959
+
change_custom_property(key,value,"$mul");
960
+
},
961
+
/**
962
+
* Save maximal value under the key of this user's custom properties
963
+
* @param {string} key - name of the property to attach to user
964
+
* @param {number} value - value which to compare to server's value and store maximal value of both provided
965
+
* */
966
+
max(key,value){
967
+
change_custom_property(key,value,"$max");
968
+
},
969
+
/**
970
+
* Save minimal value under the key of this user's custom properties
971
+
* @param {string} key - name of the property to attach to user
972
+
* @param {number} value - value which to compare to server's value and store minimal value of both provided
973
+
* */
974
+
min(key,value){
975
+
change_custom_property(key,value,"$min");
976
+
},
977
+
/**
978
+
* Add value to array under the key of this user's custom properties. If property is not an array, it will be converted to array
979
+
* @param {string} key - name of the property to attach to user
980
+
* @param {string|number} value - value which to add to array
981
+
* */
982
+
push(key,value){
983
+
change_custom_property(key,value,"$push");
984
+
},
985
+
/**
986
+
* Add value to array under the key of this user's custom properties, storing only unique values. If property is not an array, it will be converted to array
987
+
* @param {string} key - name of the property to attach to user
988
+
* @param {string|number} value - value which to add to array
989
+
* */
990
+
push_unique(key,value){
991
+
change_custom_property(key,value,"$addToSet");
992
+
},
993
+
/**
994
+
* Remove value from array under the key of this user's custom properties
995
+
* @param {string} key - name of the property
996
+
* @param {string|number} value - value which to remove from array
997
+
* */
998
+
pull(key,value){
999
+
change_custom_property(key,value,"$pull");
1000
+
},
1001
+
/**
1002
+
* Save changes made to user's custom properties object and send them to server
0 commit comments