escape character in path

This commit is contained in:
Josh Baker 2016-08-11 19:16:21 -07:00 committed by GitHub
parent 1e941a433e
commit 57e7f71ee6
1 changed files with 4 additions and 2 deletions

View File

@ -49,12 +49,13 @@ Prichard
``` ```
A path is a series of keys seperated by a dot. A key may contain special wildcard characters '*' and '?'. To access an array value use the index as the key. To get the number of elements in an array use the '#' character. A path is a series of keys seperated by a dot. A key may contain special wildcard characters '*' and '?'. To access an array value use the index as the key. To get the number of elements in an array use the '#' character.
The dot and wildcard characted can be escaped with '\'.
``` ```
{ {
"name": {"first": "Tom", "last": "Anderson"}, "name": {"first": "Tom", "last": "Anderson"},
"age":37, "age":37,
"children": ["Sara","Alex","Jack"] "children": ["Sara","Alex","Jack"],
"fav.movie": "Deer Hunter"
} }
"name.last" >> "Anderson" "name.last" >> "Anderson"
"age" >> 37 "age" >> 37
@ -62,6 +63,7 @@ A path is a series of keys seperated by a dot. A key may contain special wildcar
"children.1" >> "Alex" "children.1" >> "Alex"
"child*.2" >> "Jack" "child*.2" >> "Jack"
"c?ildren.0" >> "Sara" "c?ildren.0" >> "Sara"
"fav\.movie" >> "Deer Hunter"
``` ```