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

Add properties "nodeName", "parentNode" and contextual search #18

Open
hbi99 opened this issue Jul 30, 2014 · 4 comments
Open

Add properties "nodeName", "parentNode" and contextual search #18

hbi99 opened this issue Jul 30, 2014 · 4 comments

Comments

@hbi99
Copy link
Owner

hbi99 commented Jul 30, 2014

Enabling features such as;

var found = JSON.search( data, '//item' );

found[0].nodename
// item

found[0].parentNode
// the parent object to the found item

found[0].search('./*[id=1]');
// searches only among children of found item

@muralinit
Copy link

Hi,

I think this enhancement is not addressed yet, may I know when you guys are going to address this parent node, because lot of people are looking this kind of functionality.

Thanks & Regards,
N.Murali Krishna.

@hbi99
Copy link
Owner Author

hbi99 commented Mar 26, 2015

@muralinit
I've solved this with objects/arrays but not with simple datatypes such as string, number, boolean, etc.
So, if the found item is not simple type, the "parentNode" property can be accessed. Since, I only have half the solution, I've chosen to wait with the implementation.

@muralinit
Copy link

Well good I am using objects in my current project, so for the current situation I can use your temporary solution. One more idea is you can publish the solution and open a new issue for addressing the issue on Simple types. In my opinion most of the people will use Objects so at least there will be relief. So please give me your changes. If they are in the current check-in I will take it from there.

Thanks & Regards,
N.Murali Krishna.

@muralinit
Copy link

Hello,

Can I have your solution for objects/arrays please.

Thanks & Regards,
N.Murali Krishna.

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