Android Question CloudKVS remove key?

xulihang

Active Member
Licensed User
Longtime User
Hi,

We can put a key/value to a local cloudkvs database and the remote database will be updated as well.

I need the remote database to remove a key when the client removes a key, but cloudkvs does not have a remove method.

Is this an unusual operation that no one has implemented it? Maybe I have to add a remove method on my own.
 

BillMeyer

Well-Known Member
Licensed User
Longtime User
No not neccesary - all you need to do is the following

ckvs.Put("User1", "Key1", 100) - change the 100 to Null and it's gone

Hope this helps...
 
Upvote 0

xulihang

Active Member
Licensed User
Longtime User
No not neccesary - all you need to do is the following

ckvs.Put("User1", "Key1", 100) - change the 100 to Null and it's gone

Hope this helps...

I tested late. The null value key will still exist in the cloudkvs. But I can make the client to remove null value key which I can get from the newdata event.

Works fine for now.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I can certainly see why it was done a certain way, because its supposed to emulate a Map. There is no delete key in Map, so inserting a Null is equivalent, as there is no "Delete" in a Map. However I do feel it should remove the record instead of inserting a Null, but eh.

Anyways, I needed a method to delete an entire "User" as well, and the provisioning was started for it, but it was never completed.

I was able to mod the program and fix that. I also added a "Remove" function for individual keys as well just in case but I never found myself using it.
 
Last edited:
Upvote 0
Top