Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow different strategies for duplicate keys in JSON objects #505

Open
YintongMa opened this issue Apr 16, 2024 · 0 comments
Open

Allow different strategies for duplicate keys in JSON objects #505

YintongMa opened this issue Apr 16, 2024 · 0 comments

Comments

@YintongMa
Copy link

Both MySQL JSON parser and Rapidjson uses last-wins strategy for duplicate keys now. (see https://bugs.mysql.com/bug.php?id=86866). Could jsoncons provide an alternative option for different strategies? (last-wins/first-wins)
For example:
mysql> INSERT INTO t1 VALUES ('{"x": 17, "x": "red", "x": [3, 5, 7]}');

mysql> SELECT c1 FROM t1;
+------------------+
| c1 |
+------------------+
| {"x": [3, 5, 7]} |
+------------------+

Rapidjson has the same result. However it's '{"x": 17}' in jsoncons.

@YintongMa YintongMa changed the title Allow different strategy for duplicate keys in JSON objects Allow different strategies for duplicate keys in JSON objects Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant