Skip to content

Filter nested JSON objects fields. #445

Description

@Natim

Today it is possible to use the _fields query parameter to choose the list of fields we want.

In case of kinto-attachment, a nested object has been created, in case of our Fennec OTA use case we have this kind of records:

{
    "kind": "font",
    "original": {
        "mimetype": "application/x-font-ttf",
        "filename": "CharisSILCompact-R.ttf",
        "hash": "4ed509317f1bb441b185ea13bf1c9d19d1a0b396962efa3b5dc3190ad88f2067",
        "size": ​1727656
    },
    "last_modified": ​1455710632607,
    "attachment": {
        "mimetype": "application/x-gzip",
        "size": ​548720,
        "hash": "960be4fc5a92c1dc488582b215d5d75429fd4ffbee463105d29992cd792a912e",
        "location": "https://kinto-ota.dev.mozaws.net/attachments/0d28a72d-a51f-46f8-9e5a-f95c61de904e.gz",
        "filename": "CharisSILCompact-R.ttf.gz"
    },
    "exclude":  {
        "version": "nightly"
    },
    "type": "asset-archive",
    "id": "c906275c-3747-fe27-426f-6187526a6f06"
}

Is it possible to ask for something like:

/v1/buckets/dlc/collections/catalog/records?_fields=type,exclude,attachment.location,attachment.hash,original.mimetype,original.filename,kind

[0] https://stedolan.github.io/jq/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions