SQLite Forum

Json path with $.[#] results in json path error
Login

Json path with $.[#] results in json path error

(1) By anonymous on 2020-04-01 19:31:25 [source]

Hey, I currently evaluate the Json capabilities of SQLite. I copied some examples from the docs:

json_insert('[1,2,3,4]','$[#]',99)

but I only get

JSON path error near '[#]': SELECT json_insert('[1,2,3,4]','$[#]',99)

Are the docs not up to date? Am I doing something wrong with the path?

On another note, I don't know if this is the right place but the example

json_extract('{"a":2,"c":[4,5],"f":7}','$.c[#-1]'

is missing a parentheses at the end :).

Thanks and regards

(2) By Richard Hipp (drh) on 2020-04-01 19:36:41 in reply to 1 [link] [source]

The docs are up-to-date. I'm guessing it is your SQLite that is not. The $[#] path feature in the JSON functions was just added in the version 3.31.0. What version of SQLite are you testing with?

(3) By anonymous on 2020-04-01 19:51:33 in reply to 2 [link] [source]

I use the latest .Net System.Data.SQLite from nuget.org. It appears that this package is using version 3.30.1, so that is my issue.

Many thanks :)