JSON UDF functions version 0.3.0 have been released.

Today new version of JSON UDF functions: 0.3.0 was released. This is major release which contains new functionality. You can download functions from the MySQL Labs website.

What was added?

Functions JSON_EXTRACT, JSON_CONTAINS_KEY, JSON_APPEND, JSON_REMOVE, JSON_REPLACE, JSON_SET now accept both string and integer arguments as array indexes. (Bug #70393/17491709)

Now syntax JSON_EXTRACT(doc, 'key', 1); is accepted.

New function JSON_SAFE_MERGE checks JSON documents for validity before merging them. In addition JSON_MERGE now merges valid documents, having array as root element. (Bug #70575/17583568)

JSON_VALID now accepts array as a root element of the JSON document (Bug #70567/17583282)

Also this release contains following bug fixes:

71050/17882710 json_extract returning same column twice if key names are not fully distinct. (Fixed for JSON_EXTRACT, JSON_CONTAINS_KEY, JSON_APPEND, JSON_REMOVE, JSON_REPLACE, JSON_SET)

71180/17975709 JSON_CONTAINS_KEY founds not existent key in the array element

70579/17584678 Add ability to append last element to array in JSON_APPEND

And, of course, this release contains all changes which version 0.2.1 has

Comments:

Hi Sveta,

These JSON Udf's are potentially just gold for MySQL!
But I have one problem to use them.
The only function I really need is the JSON merge but currently when merging two json docs it duplicates key's and values that are present on both the docs being merged instead of just updates the value with the new doc... for example: json_merge( {"a":"b"}, {"a":"c"} ) returns: {"a":"b","a":"c"} instead of: {"a":"c"}
this is causing the returned doc to be non serializable and i think non legal json.
what i really need is a function that acts like json_set but for two json docs..

can you please add this?

thanks!

Posted by Yaniv Hakim on February 23, 2014 at 12:18 PM MSK #

Hi Yaniv,

yes, I can consider adding this feature. Please file a request at bugs.mysql.com under JSON UDF category.

Posted by Sveta Smirnova on February 23, 2014 at 01:30 PM MSK #

Thanks! :)
I filed a bug as you requested.

Looking forward for your fix!

Posted by Yaniv Hakim on February 23, 2014 at 03:51 PM MSK #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Working blog of Sveta Smirnova - MySQL Senior Principal Support Engineer working in Bugs Analysis Support Group

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
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
   
       
Today