4

I have a few question about ordered lists in Aerospike:

  1. How can I see in the DB, using aql, if the list is ordered or not?

  2. Does ordered list means it’s sorted?

  3. I want to scan the db and change all lists (in a specific bin) to be ordered. I want to do is using set_type, but I can’t seem to make it work. Is that possible? how can I do it?

Thanks

Bat-chen
  • 88
  • 4

2 Answers2

3

I'm posting my answer from your cross-posted question here https://discuss.aerospike.com/t/list-oprations/5282:

You could scan the namespace with a ScanPolicy.includeBinData=false and for each record digest you get back use operate() to wrap the following operations into a single transaction:

You will only need to run this once to clean up your database.

The ordering type will stick for all future operations. You'd just continue to use the ListWriteFlags.ADD_UNIQUE list policy.

This is for the Java client, but all other clients have these operations and policies in them.

Ronen Botzer
  • 6,951
  • 22
  • 41
2

I don't think AQL is the right tool to exploit the full power of lists. Perhaps it is not yet updated to the full functionality of lists. It is built on top of the C client. At least AQL ver 3.15.2.1 that I checked with is not. You might want to write a java client application.

pgupta
  • 5,130
  • 11
  • 8