R RJB Active Member Licensed User Longtime User Apr 18, 2021 #1 Hi, Is it possible to store multiple maps (potentially with the same keys) in the same Key Value Store using PutMapAsync? The answer seems to be no and the following seem to be the case: - Keys in the maps which will be 'Put' have to be strings - Keys in multiple maps have to be unique, i.e. a key of "1" can't be used in more than one of the maps to be 'Put' otherwise one will overwrite the other. - Keys in maps can't be the same as those for other entries in the KVS, i.e. KVS.Put("1", "One") will be overwritten by a map which contains "1" in it's keys Am I right in these assumptions and if so is there an simple way to store maps using the same keys? Thanks
Hi, Is it possible to store multiple maps (potentially with the same keys) in the same Key Value Store using PutMapAsync? The answer seems to be no and the following seem to be the case: - Keys in the maps which will be 'Put' have to be strings - Keys in multiple maps have to be unique, i.e. a key of "1" can't be used in more than one of the maps to be 'Put' otherwise one will overwrite the other. - Keys in maps can't be the same as those for other entries in the KVS, i.e. KVS.Put("1", "One") will be overwritten by a map which contains "1" in it's keys Am I right in these assumptions and if so is there an simple way to store maps using the same keys? Thanks
Erel B4X founder Staff member Licensed User Longtime User Apr 18, 2021 #2 PutMapAsync is equivalent to calling Put with each of the key / value pairs (asynchronously). It doesn't store the map as a separate map. If you want to store a map as a single item: Code: Copy Dim m As Map = CreateMap(12: "twelve", "one": 1) KVS.Put("map 1", m) 'or KVS.PutMapAsync(CreateMap("map 1": m)) This should answer all your questions. Upvote 0
PutMapAsync is equivalent to calling Put with each of the key / value pairs (asynchronously). It doesn't store the map as a separate map. If you want to store a map as a single item: Code: Copy Dim m As Map = CreateMap(12: "twelve", "one": 1) KVS.Put("map 1", m) 'or KVS.PutMapAsync(CreateMap("map 1": m)) This should answer all your questions.