Skip to content

olegrok/tarantool-jsonpath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tarantool jsonpath introspection tool

Validation

jsonpath = require('jsonpath')
tarantool> jsonpath.validate('["a"].b.c[4]') -- valid jsonpath
---
- true
...
tarantool> jsonpath.validate('["a"].b.c[4')  -- invalid jsonpath
---
- false
- 12 -- bad position
...

Token extraction

jsonpath = require('jsonpath')
tarantool> jsonpath.extract_tokens('["a"].b.c[4][*]')
---
- 1:
    type: 2
    value: a
  2:
    type: 2
    value: b
  3:
    type: 2
    value: c
  4:
    type: 1
    value: 4
  5:
    type: 3
  6:
    type: 4
...
tarantool> jsonpath.JSON_TOKEN_TYPE
---
- JSON_TOKEN_END: 4
  JSON_TOKEN_ANY: 3
  JSON_TOKEN_NUM: 1
  JSON_TOKEN_STR: 2
...

About

Jsonpath introspection tool for Tarantool

Topics

Resources

Stars

Watchers

Forks

Languages