CRUD List contained in a map

I have a data structure something like this : { id : address : [ { id : }, { id : } ] } So how can i achieve this in aerospike. Should i use the List data structure or and suggestion regarding this.

Thank you.

This question really belongs more under the Data Modeling topic, since it’s not specific to the Node.js client.

A bit more information about your use case and the typical query patterns would also be useful. I.e. you have an id field for each entry in your list of addresses. Would you even need to lookup a specific address by it’s ID? In that case it would be better to model the address bin as a map, where the keys of the map are the IDs of your addresses, and the values of the map are also each nested maps with the details of the address.

Hello Jan, Thanks for the response. My use case is i have to save users and its related address. And perform CRUD operations on address. My understanding of your response is the below JSON. If you could verify that, it would be of great help. And if it is correct how will i manage update operations on address because of the dynamic nature keys in the address object. { id: “userid”, address: { aId: {detail }, a2Id: { detail } } }

Yes, based on your description of your use case, that seems like a good way to structure your data in Aerospike.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.