0

I'm using PouchDB 7 with the find plugin. I would like to retrieve specific information by using mango query. But when a specific value is inside an object, the previous value is not returned.

Example

{
    "selector": {
        "docType": "client"
    },
    fields: [
        "_id",
        "docData.name",
        "docData.lastName",
        "docData.address.street",
        "docData.age"
    ]
}

The example return:

[
    {
        "_id": 1,
        "docData": {
            "age": 21
        }
    },
    {
        "_id": 2,
        "docData": {
            "age": 22
        }
    }
]

But that same mango query, returns the document correctly on couchdb. Does anyone know what can it be?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Hiago Souza
  • 171
  • 1
  • 2
  • 12
  • why dont you add only `docData` in the `fields` array??? Do you need only specific values from `docData` object? – Ravi Shankar Bharti Jun 26 '18 at 06:10
  • Yes Exactly, I only need specific docData properties. For if I recover everything I will have more information than necessary needed in my application. – Hiago Souza Jun 26 '18 at 21:19
  • The strange thing is that this syntax works on couchdb and does not work on pouchdb, since both use the mango query, – Hiago Souza Jun 26 '18 at 21:19

0 Answers0