Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im writing a ubuntu touch app with u1db as db, but im getting troubles with query and index. Im saving a doc with sub-fields, but at retrieve point with index and query i wont get the expected resutls. I need the list to show two rows one for the account "Ahorro" another one for the account "Corriente" but only one row show, the first one.

can anyone help me?

Here i post my code:

UbuntuListView {
        id: accountListView
        anchors.margins: accountLabel.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.bottom: parent.bottom
        model: accountQuery
        delegate: ListItem.SingleValue {
            text: contents["name"]
            progression: true
            onClicked: {
    U1db.Database {
        id: myMoneyDB
        path: "MyMoney.u1db"
    U1db.Document {
        id: accountDocument
        database: myMoneyDB
        docId: 'account'
        create: true
        defaults: {
                    "name": "Ahorro"
                    "name": "Corriente"
        database: myMoneyDB
        id: accountIndex
        expression: [""]
        id: accountQuery
        index: accountIndex
        query: "*"

Thanks in advance.

share|improve this question
#ubuntu-app-devel sometimes is a good place lurk for help. – Akiva Aug 12 '14 at 3:43

Your code add only one database record with two fields into the database. You have to add a "U1db.Document()" for each record.

Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.