Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter nested JSON objects fields. #445

Closed
Natim opened this issue Feb 18, 2016 · 1 comment
Closed

Filter nested JSON objects fields. #445

Natim opened this issue Feb 18, 2016 · 1 comment

Comments

@Natim
Copy link
Member

Natim commented Feb 18, 2016

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/

Natim pushed a commit to mozilla-services/cliquet that referenced this issue Feb 18, 2016
@Natim Natim changed the title Let filter nested JSON objects fields. Filter nested JSON objects fields. Feb 18, 2016
leplatrem pushed a commit to mozilla-services/cliquet that referenced this issue Feb 23, 2016
@Natim
Copy link
Member Author

Natim commented Feb 25, 2016

Fixed in #660

@Natim Natim closed this as completed Feb 25, 2016
@leplatrem leplatrem modified the milestone: 1.12 Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants