1 person found this helpful
If you need an efficient way to view the keys as a java.util.Collection or Set, use PrimaryIndex.sortedMap().keySet(). This does not copy the keys -- the returned Set is a "view" on the database -- so it is appropriate for large numbers of keys and high performance applications.
If you must have a List, or you want to make a copy of the keys, then you can pass the key set (PrimaryIndex.sortedMap().keySet()) to the constructor of an ArrayList (for example) to copy it easily.
Thanks Mark !!