Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Error when trying to reference a sub-object #6

Open
mangvlad opened this issue Feb 4, 2014 · 2 comments
Open

Error when trying to reference a sub-object #6

mangvlad opened this issue Feb 4, 2014 · 2 comments

Comments

@mangvlad
Copy link

mangvlad commented Feb 4, 2014

I have this JSON:

{
"test": "123",
"object": { "subobject": "567", "another": "xyz"}
}

trying to get:

{
"object": {"subobject": "567"}
}

My query is: '$select=object.subobject'

But parser.parse('$select=object.subobject') gives me the following error: [TypeError: Object subobject has no method 'unshift'].

Any suggestion for how/where I can fix it?

@eturan
Copy link

eturan commented Jul 4, 2014

Also I have same problem! Waiting for solution

@prantlf
Copy link
Contributor

prantlf commented Dec 27, 2014

Shouldn't you use the / (forward slash) as the select property path delimiter? Parsing $select=object/subobject yields the expected output:

{
  "$select": [
    "object/subobject"
  ]
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants