Repository navigation
Expand file tree
/
Copy pathsingular_path_selector.json
More file actions
88 lines (88 loc) · 2.42 KB
/
Copy pathsingular_path_selector.json
File metadata and controls
88 lines (88 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
"tests": [
{
"name": "object name from embedded singular query",
"selector": "$.a[$.b[1]]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] } },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": [{ "q": [4, 5, 6] }],
"result_paths": ["$['a']['p']"],
"tags": ["extra"]
},
{
"name": "array index from embedded singular query",
"selector": "$.a.j[$['c d'].x.y]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] } },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": [2],
"result_paths": ["$['a']['j'][1]"],
"tags": ["extra"]
},
{
"name": "embedded singular query does not resolve to a string or int value",
"selector": "$.a[$.b]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] } },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": [],
"result_paths": [],
"tags": ["extra"]
},
{
"name": "object name from embedded singular query resolving to nothing",
"selector": "$.a[$.foo]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] } },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": [],
"result_paths": [],
"tags": ["extra"]
},
{
"name": "array index from embedded singular query resolving to nothing",
"selector": "$.b[$.foo]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] } },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": [],
"result_paths": [],
"tags": ["extra"]
},
{
"name": "array index from embedded singular query is not an int",
"selector": "$.b[$.a.z]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] }, "z": "foo" },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": [],
"result_paths": [],
"tags": ["extra"]
},
{
"name": "array index from embedded singular query is negative",
"selector": "$.b[$.a.z]",
"document": {
"a": { "j": [1, 2, 3], "p": { "q": [4, 5, 6] }, "z": -1 },
"b": ["j", "p", "q"],
"c d": { "x": { "y": 1 } }
},
"result": ["q"],
"result_paths": ["$['b'][2]"],
"tags": ["extra"]
}
]
}