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

Ability to specify fields to return by nested keys #397

Closed
abovedave opened this issue Mar 21, 2018 · 3 comments
Closed

Ability to specify fields to return by nested keys #397

abovedave opened this issue Mar 21, 2018 · 3 comments
Milestone

Comments

@abovedave
Copy link
Contributor

abovedave commented Mar 21, 2018

Currently, I'm unable to filter specific fields of a Reference object in a Web datasource.

E.g., The query would be fields={"title": 1, "author.name": 1}

{
  "datasource": {
    "key": "articles",
    "source": {
      "endpoint": "1.0/publisher/articles"
    },
    "paginate": 1,
    "count": 1,
    "fields": {
      "title": 1,
      "author.name": 1
    }
  }
}

This returns the title field, but a blank author array (author is a reference field)

{
  "results": [
    {
      "_composed": {
        "author": []
      },
      "_id": "5a946688dc5fc266552d2f25",
      "author": [],
      "title": "Why you should open source your website"
    },
    {
      "_composed": {
        "author": []
      },
      "_id": "5a9684827abb4273bcce608d",
      "author": [],
      "title": "Forming an orderly queue"
    }
}
@abovedave abovedave changed the title Ability to filter by nested fields Ability to specify fields to return by nested values Mar 21, 2018
@jimlambie jimlambie added this to the 4.0.0 milestone Mar 21, 2018
@abovedave abovedave changed the title Ability to specify fields to return by nested values Ability to specify fields to return by nested keys Mar 21, 2018
@eduardoboucas
Copy link
Contributor

Isn't this a duplicate of #329?

@jimlambie
Copy link
Contributor

@eduardoboucas yes it is!

@eduardoboucas
Copy link
Contributor

I'll close and fix. Then we'll all be happy. 👨‍👧‍👦

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

3 participants