example:
type person = { name : string
; age : int
}
db /person : intmap(person)
I know how to get a single person from the db, but how do I get them all? and print them in a html table?
Thx.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I advise you to use Db.intmap_fold_range instead of InMap.fold.
It will be faster than InMap.fold which need to build the all map in OPA before folding on it.
http://opalang.org/resources/doc/index.html#db.opa.html/!/value_stdlib.core.db.Db.intmap_fold_range
Here is an example for your type: