Coder Social home page Coder Social logo

jsonpath's Introduction

Gatsby

Gatsby's blog starter

Kick off your project with this blog boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React.

Have another more specific idea? You may want to check out our vibrant collection of official and community-created starters.

πŸš€ Quick start

  1. Create a Gatsby site.

    Use the Gatsby CLI to create a new site, specifying the blog starter.

    # create a new Gatsby site using the blog starter
    gatsby new my-blog-starter https://github.com/gatsbyjs/gatsby-starter-blog
  2. Start developing.

    Navigate into your new site’s directory and start it up.

    cd my-blog-starter/
    gatsby develop
  3. Open the source code and start editing!

    Your site is now running at http://localhost:8000!

    Note: You'll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

    Open the my-blog-starter directory in your code editor of choice and edit src/pages/index.js. Save your changes and the browser will update in real time!

🧐 What's inside?

A quick look at the top-level files and directories you'll see in a Gatsby project.

.
β”œβ”€β”€ node_modules
β”œβ”€β”€ src
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .prettierrc
β”œβ”€β”€ gatsby-browser.js
β”œβ”€β”€ gatsby-config.js
β”œβ”€β”€ gatsby-node.js
β”œβ”€β”€ gatsby-ssr.js
β”œβ”€β”€ LICENSE
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
└── README.md
  1. /node_modules: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.

  2. /src: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. src is a convention for β€œsource code”.

  3. .gitignore: This file tells git which files it should not track / not maintain a version history for.

  4. .prettierrc: This is a configuration file for Prettier. Prettier is a tool to help keep the formatting of your code consistent.

  5. gatsby-browser.js: This file is where Gatsby expects to find any usage of the Gatsby browser APIs (if any). These allow customization/extension of default Gatsby settings affecting the browser.

  6. gatsby-config.js: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the config docs for more detail).

  7. gatsby-node.js: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.

  8. gatsby-ssr.js: This file is where Gatsby expects to find any usage of the Gatsby server-side rendering APIs (if any). These allow customization of default Gatsby settings affecting server-side rendering.

  9. LICENSE: This Gatsby starter is licensed under the 0BSD license. This means that you can see this file as a placeholder and replace it with your own license.

  10. package-lock.json (See package.json below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won’t change this file directly).

  11. package.json: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.

  12. README.md: A text file containing useful reference information about your project.

πŸŽ“ Learning Gatsby

Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:

  • For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.

  • To dive straight into code samples, head to our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.

πŸ’« Deploy

Deploy to Netlify

Deploy with Vercel

jsonpath's People

Stargazers

 avatar

Watchers

 avatar

jsonpath's Issues

The php code does not consider $expr = '0' in the trace() function

What steps will reproduce the problem?
$data = array('foo' => array('a', 'b'))
jsonPath($data, '$.foo.0') returns the wrong result

What is the expected output? What do you see instead?
Expected output is array(0 => 'a')
Actual output is array(array(0 => 'a'))

What version of the product are you using? On what operating system?
jsonPath0.8.1.php on linux

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 8 Sep 2011 at 10:29

filter can't contain @ or .

What steps will reproduce the problem?
1. open jp.html
2. check output of 
            out += jsonPath(apps, "$.organizations[?(@.name=='[email protected]')]..apps").toJSONString() + "\n";
3. false does not make sense.

What is the expected output? What do you see instead?
expect -                 [{
                "name":"bars",
                "apps":[{ "name":"bara",
                          "version":"1"
                }]
              }]

What version of the product are you using? On what operating system?
jsonpath 0.8

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 9 Apr 2014 at 3:26

access to element starting with @

What steps will reproduce the problem?
==call==
jsonPath(self, '$..DIV[?(@.@class==\'value\')]').length
==input==
var arr={ "DIV": [{"@class":"value","val":5}] };

What is the expected output? What do you see instead?
Expected 1, returned 0

What version of the product are you using? On what operating system?
jsonpath-0.8.0.js
Β‘Javascript!

Please provide any additional information below.
The problem is about notation. In the notation, "@" has the meaning of 
actual object but an attribute starting with "@" is handled as actual 
object. I suggest to change the "@" simbol for another that is reserved in 
XML.
I suggest to visit: "http://www.w3.org/TR/xml/#NT-NameChar" for change the 
symbol.


Original issue reported on code.google.com by [email protected] on 13 Aug 2009 at 10:57

Attempting to access a property value with an @ sign.

Attempting to access a property value with an @ sign.

The query is dynamically built and needs to be able to evaluate any string. 
What steps will reproduce the problem?
1. Using this object

{
"report": {
    "Author": [
        {
            "value": "John",
            "count": "58",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "12314"

                },
                {
                    "key": "Date",
                    "value": "2000-01-01"
                }
            ]
        },
        {
            "value": "Jane",
            "count": "1",
            "fields": [
            ]
        },
        {
            "value": "[email protected]",
            "count": "58",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "12314"

                },
                {
                    "key": "Date",
                    "value": "2000-01-01"
                },
                {
                    "key": "tags",
                    "value": "a,b,c,d"
                }         
            ]
        },
        {
            "value": "Bill",
            "count": "2",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "14"

                }
            ]
        }
    ]
}
}

2. Using this path

$.report.Author[?(@.value==='[email protected]')]

What is the expected output? What do you see instead?
Expected - [{
            "value": "[email protected]",
            "count": "58",
            "fields": [
                {
                    "key": "FileSize",
                    "value": "12314"

                },
                {
                    "key": "Date",
                    "value": "2000-01-01"
                },
                {
                    "key": "tags",
                    "value": "a,b,c,d"
                }         
            ]
        }]

Actual result - False

What version of the product are you using? On what operating system?
JSONPath 0.8.0
Windows Server 2008 R2 - IIS 7.5

Please provide any additional information below.

I've also tried 
$.report.Author[?(@.value==='\[email protected]\')] with no luck.

Since the value can actually be any string I can't escape in string.

Original issue reported on code.google.com by [email protected] on 1 Oct 2012 at 7:02

C#, Negative Phyton slice

parseInt does not allow negative numbers (NumberStyles.None), this prevents 
negative index selectors from working as expected. Personal fix was to use 
NumberStyles.AllowLeadingSign

eg. $.data[0].values[-1:].value would return all values in path 
$.data[0].values[*].value instead of expected values.

Original issue reported on code.google.com by [email protected] on 16 Dec 2013 at 10:08

Test page showing inputs and expectations - for regression testing

Having the test page tests/jsonpath-test-js.html show a variety of example 
objects, expressions and results is really useful. 

To make sense of it you need to review the output of the page (in a browser) - 
which only shows the results - side-by-side with the HTML source. 

The attached is an attempt to put all the useful information in the viewable 
page - namely what the source data object was and the input expression. Further 
to this I've included the expectations to potentially allow for regression 
testing - e.g. comparison of behaviour for different jsonpath.js versions by 
seeing what "fails" the expected vs actual test. 

So in summary, starting with the jsonpath-test-js.html, the changes in the 
attached include:
- reference to jsonpath.js is relative from /tests (../src/js/jsonpath.js)
- removed reference to json.js and using JSON.stringify(..) instead
- display (in tabular layout) the source data, expression and results
- structure of the test data changed to be (excuse the made up JSON schema):
     var suite =  [ <test-objects> ];
     <test-object>:  { 
        "comment": <optional test comment>,
        "data": <source object>,
        "tests": [ <expression-test-objects> ]
    }
    <expression-test-objects>: { 
         "expr": <jsonpath expression>, 
         "comment": <optional expression comment>,
         "paths": [ <expected PATH result as 0-to-many paths> ], 
         "values": [ <expected VALUE result as 0-to-many paths> ]
    }
- each expression test runs the path and value tests separately and compares 
the results with the expectations. This is different to jsonpath-test-js.html 
which only obtained the "PATH" result then obtained the values via 'evaluate'. 
Presently, there's one test failing the "VALUE" result (Test #2, Expression 
#1). 
- if a comparison between expected & actual fails, the actual result is 
stringified onto the page (perhaps to help update expectations)
- no-result 'false' is turned into empty array [] 
- added in the 'bookstore' data and example expressions and expectations from 
the Wiki 


I'm hoping someone else finds this useful ... 

Consider for inclusion in the project? Potentially, new issues could be 
captured as new "<test-object>" definitions - showing the expectation, and the 
page will show if it fails. 



Original issue reported on code.google.com by [email protected] on 16 Jul 2013 at 2:46

Attachments:

How to reference keys?

With the resolution of Issue 6 in 0.8.4 I can now do

   jsonPath({'x': {'y': 'z', 'yy': 'zz'}}, "$")

to get back 'x'  and $.x.y to get 'z'

Question: how do I reference 'y' i.e. the first key 'in' x?

I'm pretty sure there is an equivalent in xpath..?


Original issue reported on code.google.com by [email protected] on 22 Nov 2009 at 8:29

using filters seems to skip a level

First off, many thanks for creating JsonPath - I'm having great fun with 
it! However, I think I may have found an issue. When performing a JsonPath 
query on a data structure containing something like

    "dataResult" : { 
        "object" : { 
            "objectInfo" : { 
                "className" : "folder",
                "typeName" :  "Standard Folder",
                "id" : "uniqueId"
            },

then running a query like $..object.objectInfo[?(@.className=='folder')] 
returns no results. 
However, running the query $..object[[email protected]=='folder')] does produce 
results.

It looks as though the JsonPath code is skipping the 

the attached HTML file contains an example, including what I think is a 
possible fix, although not being an expert, I've probably got things wrong.

Best regards,
Nick Walker



Original issue reported on code.google.com by [email protected] on 19 Dec 2007 at 5:05

Attachments:

Improve performance by avoiding closures (js-version)

You should avoid closures inside of the jsonPath()-function in the js-version 
in order to improve performance.

Example:

(function() {
   function doSomething() {};
   function jsonPath() {
      doSomething();
   };
})();

is faster than

function jsonPath() {
   function doSomething() {};
   doSomething();
}

because those functions have to be created by the js-interpreter on every call 
to jsonPath.

Original issue reported on code.google.com by [email protected] on 31 Oct 2010 at 3:40

Member names containing dot fail

What steps will reproduce the problem?
1. Member names in pathes containing dot '.' should work, if it is enclosed
in single quotes, as in {{{$['a.b']}}}.



Original issue reported on code.google.com by [email protected] on 19 Sep 2007 at 1:11

Would appreciate an code example for C#

I'm having some difficulty to figure out how to use the .net version on 
jsonpath. Would you mind add a example taking a string with json and a string 
with jsonpath and return a result?

Original issue reported on code.google.com by [email protected] on 24 Sep 2011 at 6:14

Python port available

Based on JavaScript and Perl versions.

http://www.ultimate.com/phil/python/
http://pypi.python.org/pypi/jsonpath/


Original issue reported on code.google.com by [email protected] on 28 Apr 2009 at 9:13

parse object names

I am wondering if there is a way to extract object names from a json file. I am 
working with data from archive.org and they used file names as json object 
names. i.e. 
http://www.archive.org/details/gd1980-09-06.aud.morris.106620.flac24&output=json
 files

I have been using http://jsonpath.curiousconcept.com/ to set my queries

I can get all the file objects with $.files
I can get the value of an atribute for all the file objects with 
$.files.*.format

But what I want is the file names, which are the names of the file objects.

Original issue reported on code.google.com by [email protected] on 3 Jan 2012 at 5:37

perl port available

Ported this to Perl, VALUE works fine, PATH option is not fully functional
though. 

Additionally I've added "!" as a special character which will list all the
keys in the hash pointed to by hash indicated in the JSONPath expression.

Latest version, and documentation notes, available here:

http://github.com/masukomi/jsonpath-perl/tree/master

Original issue reported on code.google.com by [email protected] on 27 Oct 2008 at 4:16

query returns to may hits despite predicate on parent element

Hi Stefan

I have now find the correct place for Jsonpath issues!

I have posted a mini demo here:

https://github.com/sailfishapps/ThrowawayDemos/blob/master/Kaputt/JsonDBDemo

This runs on Sailfish using Qt QML / Javascript

The json file has 3 entities / elements, landed, area and template. Landed is 
the root, and template is a child of area.

The json file has 3 areas, each with 2 child templates.

If I apply the following query:

$.landed.area[?(@.id = 1)].template[*]

I expect to get only the templates that belong to the area with id 1. (i.e. 2 
hits)

Instead I get all templates of all areas. (i.e. 6 hits)

I am running jsonpath 0.8.5

As a first step to understanding what your code is doing, I have added some 
console.log calls to the trace function.

The output shows that template is being processed 3 times (once for each area). 
I expect it to be processed only once due to the predicate on area.

GrΓΌsse

Chris

[email protected]

//start json file
{
   "landed":{
      "area":[
         {
            "id":1,
            "name":"South Africa",
            "template":[
               {
                  "id":1,
                  "name":"DefaultOKMsg"
               },
               {
                  "id":2,
                  "name":"DefaultNotOKMsg"
               }
            ]
         },
         {
            "id":3,
            "name":"Schweiz",
            "template":[
               {
                  "id":1,
                  "name":"DefaultOKMsg"
               },
               {
                  "id":2,
                  "name":"DefaultNotOKMsg"
               }
            ]
         },
         {
            "id":4,
            "name":"Italia",
            "template":[
               {
                  "id":1,
                  "name":"DefaultOKMsg"
               },
               {
                  "id":2,
                  "name":"DefaultNotOKMsg"
               }
            ]
         }
      ]
   }
}
//end json file

//start console. log output
[D] getTemplates:50 - getting Templates for area: undefined
[D] parseJSONString:12 - about to pass DB to JSONPath
[D] P.trace:33 - trace: expr:landed;area;?(@.id = 1);template;*
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$
[D] P.trace:33 - trace: expr:area;?(@.id = 1);template;*
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed
[D] P.trace:33 - trace: expr:?(@.id = 1);template;*
[D] P.trace:34 - trace: val:[object Object],[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area
[D] P.trace:33 - trace: expr:0;template;*
[D] P.trace:34 - trace: val:[object Object],[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area
[D] P.trace:33 - trace: expr:template;*
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;0
[D] P.trace:33 - trace: expr:*
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;0;template
[D] P.trace:33 - trace: expr:0;
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;0;template
[D] P.trace:33 - trace: expr:
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;0;template;0
[D] P.trace:33 - trace: expr:1;
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;0;template
[D] P.trace:33 - trace: expr:
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;0;template;1
[D] P.trace:33 - trace: expr:1;template;*
[D] P.trace:34 - trace: val:[object Object],[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area
[D] P.trace:33 - trace: expr:template;*
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;1
[D] P.trace:33 - trace: expr:*
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;1;template
[D] P.trace:33 - trace: expr:0;
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;1;template
[D] P.trace:33 - trace: expr:
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;1;template;0
[D] P.trace:33 - trace: expr:1;
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;1;template
[D] P.trace:33 - trace: expr:
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;1;template;1
[D] P.trace:33 - trace: expr:2;template;*
[D] P.trace:34 - trace: val:[object Object],[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area
[D] P.trace:33 - trace: expr:template;*
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;2
[D] P.trace:33 - trace: expr:*
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;2;template
[D] P.trace:33 - trace: expr:0;
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;2;template
[D] P.trace:33 - trace: expr:
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;2;template;0
[D] P.trace:33 - trace: expr:1;
[D] P.trace:34 - trace: val:[object Object],[object Object]
[D] P.trace:35 - trace: path:$;landed;area;2;template
[D] P.trace:33 - trace: expr:
[D] P.trace:34 - trace: val:[object Object]
[D] P.trace:35 - trace: path:$;landed;area;2;template;1
[D] parseJSONString:14 - readDataModel.js: objectArray.length: 6
//end console.log output






Original issue reported on code.google.com by [email protected] on 10 Feb 2014 at 9:55

Fail to detect wrong syntax

What steps will reproduce the problem?
1. Use syntax like: $.['number']

What is the expected output? What do you see instead?
This syntax is not documented, but it is treated as an equivalent to $..number.

What version of the product are you using? On what operating system?
0.8.0

Please provide any additional information below.
replace(/;;;|;;/g, ";..;") in normalize should be the problem

Original issue reported on code.google.com by [email protected] on 6 Jul 2014 at 3:07

Filter example on main JSONPATH page is incorrect

See http://goessner.net/articles/JsonPath/

An example object and expression filters out any book that has a price greater 
than 10:

  $.store.book[?(@.price < 10)].title

This expression returns 4 titles, when it should return only 2 titles.

The correct expression is:

  $.store.book[?(@['price'] < 10)].title

...Running against jsonpath for PHP.

Original issue reported on code.google.com by [email protected] on 13 Dec 2011 at 9:48

jsonPath breaks when minified

What steps will reproduce the problem?
1. Minify jsonpath.js using MS Build Extensions in Visual Studio 2012
2. Execute a query such as: jsonPath(json, "$.foo[?(@.bar == 'somevalue')]")


What is the expected output? What do you see instead?
Expected Object or false. Instead see the following error in Chrome's 
javascript console: 
Uncaught SyntaxError: jsonPath: _v is not defined: _v.foo[?(@.bar == 
'somevalue')] 

What version of the product are you using? On what operating system?
jsonPath 0.8.0, Windows 8 x64

Please provide any additional information below.
The same query works as expected with the un-minified jsonpath.js
Attached Minified jsonpath.js

Original issue reported on code.google.com by [email protected] on 26 Apr 2013 at 9:59

Attachments:

path expression to root "$" doesn't work properly

What steps will reproduce the problem?

  Using "$" as path expression to the object root results in "no match".

What is the expected output? 

  the complete object.

What do you see instead?

  "no match"


Original issue reported on code.google.com by [email protected] on 19 Dec 2007 at 2:41

Suggestion: another types of result

In larger JSON framework, for jsonpath analysis
it might be usefull to have more resultTypes:

* normalized path - just steps of path as an array 
(w/out tracing target object)

if( P.resultType == "WAY" ) return P.normalize(expr).split(';');
P.trace(P.normalize(expr).replace(/^\$;/,""), obj, "$");
return P.result.length ? P.result : false;

* normalized traced path - with expanded expressions/filters/slices
asTrace: function(path) { return path.split(";"); }
store: function(p, v) { 
  if (p) P.result[P.result.length] = 
    ( P.resultType == "PATH" ? P.asPath(p) : 
    ( P.resultType == "TRACE" ? P.asTrace(p) : v));
  return !!p;
},

Original issue reported on code.google.com by [email protected] on 4 Nov 2009 at 12:19

toJSONString is not a function

What steps will reproduce the problem?
1. Include jsonpath.js file 
2. Try to parse any .json file
3. display returned json data

What is the expected output? What do you see instead?
JSON text
false

What version of the product are you using? On what operating system?
jsonpath-0.8.0.js

Please provide any additional information below.



Original issue reported on code.google.com by [email protected] on 25 Jul 2015 at 7:58

using '@' in a property name breaks it.

What steps will reproduce the problem?
1. Using this object
{"@position": '18',
"@unid": '29CD471ED18EE9B88725740E0006853D',
"@noteid": '982',
"@siblings": 51,
entrydata: [
{
"@columnnumber": 0,
"@name": 'first',
text: {
0: 'test3'
}
},
{
"@columnnumber": 1,
"@name": 'last',
text: {
0: 'last3'
}
},
{
"@columnnumber": 2,
"@name": 'company',
text: {
0: 'company3'
}
},
{
"@columnnumber": 3,
"@name": 'email',
text: {
0: '[email protected]'
}
},
{
"@columnnumber": 4,
"@name": 'time',
text: {
0: '3:00 PM'
}
}
]
}

2. using this xpath does not work
jsonPath(obj, "entrydata[?(@['@name']=='first')].text[0]")

3. if I rename the property '@name' to 'name' it works

I am working with a server side response that i cannot alter... any ideas?

Original issue reported on code.google.com by [email protected] on 17 Mar 2008 at 7:24

filter expression doesn't work properly

What steps will reproduce the problem?
==call==
jsonPath(arr, '$..book[?(@.isbn)]').length
==input==
var arr={ "store": {
    "book": { "isbn": "0-553-21311-3"} 
};


What is the expected output? What do you see instead?
Expected 1, returned 0

What version of the product are you using? On what operating system?
jsonpath-0.8.0.js
Β‘Javascript!

Please provide any additional information below.
The problem is that in the "trace" function, in the case of "[?(expr)]" the
function P.walk is applied for arrays but the simple case is not handled.
A temporal solution, that works is add a line of code to the "[?(expr)]" case:
----------Old code------------:
else if (/^\?\(.*?\)$/.test(loc)) // [?(expr)]
  P.walk(loc, x, val, path, function(m,l,x,v,p) { if
(P.eval(l.replace(/^\?\((.*?)\)$/,"$1"),v[m],m)) P.trace(m+";"+x,v,p); });
----------New code------------:
else if (/^\?\(.*?\)$/.test(loc)){ // [?(expr)]  Added curly brace, 2 lines
 if (P.eval(loc.replace(/^\?\((.*?)\)$/,"$1"),val,null))
P.trace(x,val,path);  //Added, to handle just this node
 P.walk(loc, x, val, path, function(m,l,x,v,p) { if
(P.eval(l.replace(/^\?\((.*?)\)$/,"$1"),v[m],m)) P.trace(m+";"+x,v,p); });
            }

Original issue reported on code.google.com by [email protected] on 13 Aug 2009 at 10:40

Dictionary keys containing dots can't be found

What steps will reproduce the problem?
1. Use a json that contain a dictionary with a key that contains a dot (for 
example: {'34.3': 'value'} )
2. Try to query from the dictionary key with a dot (for example $.['34.3'])
3. Nothing will be found (but if '34.3' was '34_3', then it'd work)

What is the expected output? What do you see instead?
It should be able to query dictionary keys containing dots inside, but it isn't.

What version of the product are you using? On what operating system?
Python 2.7 with the latest version of the JsonPath library

Please provide any additional information below.
It seem that when I try to query something like "$['34.4']" it is transformed 
into "$.34.4" before querying, which causes the problem

Original issue reported on code.google.com by [email protected] on 4 Jul 2014 at 1:25

Escape any character in property names

For Issue 7, the code looks explicitly for \\@  as an escaped element in the 
field name. This is a great feature that should be expanded to include other 
characters that need to be escaped, like dash ('-'). It is common to have 
dashes in field names:

{
  "first-name" : "Matt",
  "last-name" : "Bishop"
}

Original issue reported on code.google.com by [email protected] on 13 Dec 2011 at 9:17

json_decode stdclass compatibility

What steps will reproduce the problem?
jsonPath(json_decode('{ "data1": "value"}'), "$.data1");

What is the expected output? What do you see instead?
expected: array("value")
returned: false

What version of the product are you using? On what operating system?
0.8.1

Please provide any additional information below.
jsonPath(json_decode('{ "data1": "value"}', true), "$.data1"); works fine 
because the json is decoded as an array.
it seems like json decoded in object (stdclass) doesn't work.

Original issue reported on code.google.com by [email protected] on 17 Feb 2015 at 12:23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.