Opa: iterate through a database

235 views Asked by At

I've create and populated an opa database, and I'd like to iterate through it's records. How can I do that?

I've created a database as follows:

db /files stringmap(binary)

Then, I have stored some files in this db:

/files[filename1] <- file1
/files[filename2] <- file2
...

Now, what I'd like to to is to iterate though the database to get all the couples (filename, file) recorded. (So that I can list them on a webpage)

Is that possible? Or do I have to create another database (for instance an intmap(string)) to store the filenames using consecutive id, and then use this consecutive ids to get the filenames in the intmap, and from them get the files in the stringmap(binary)?

0

There are 0 answers