json-path-processor icon indicating copy to clipboard operation
json-path-processor copied to clipboard

$.me.1 vs $.me[1]

Open listentorick opened this issue 9 years ago • 1 comments

You seem to follow a different approach to selecting items in an array than this http://goessner.net/articles/JsonPath/

$.me.1 vs $.me[1]

Any particular reason?

I'm considering forking this project to support this approach. Is this something you would merge back in?

listentorick avatar May 10 '16 13:05 listentorick

I support foo.bar style path just because it's more simple and straightforward in JavaScript, but I think foo['bar'] is also good. Here are some points:

  1. To parse foo['bar'][0] will cost a little more than foo.bar.0
  2. The style foo['bar'][0] is a little bit longer than foo.bar.0

zordius avatar May 11 '16 01:05 zordius