harry
September 11, 2020, 12:42pm
1
Hi,
Wondering if RedisJSON provides an interface to merge two JSON documents, or does it need to be applied by the client/application?
Joe
September 14, 2020, 1:19pm
2
I don’t think there is a native command to merge 2 docs:
# RedisJSON Commands
## Overview
### Supported JSON
RedisJSON aims to provide full support for [ECMA-404 The JSON Data Interchange Standard](http://json.org/).
Below, the term _JSON Value_ refers to any of the valid values. A _Container_ is either a _JSON Array_ or a _JSON Object_. A _JSON Scalar_ is a _JSON Number_, a _JSON String_ or a literal (_JSON False_, _JSON True_ or _JSON Null_).
### RedisJSON API
Each of the module's commands is described below. Each section
header shows the syntax for the command, where:
* Command and subcommand names are in uppercase, for example `JSON.SET` or `INDENT`
* Mandatory arguments are enclosed in angle brackets, e.g. `<path>`
* Optional arguments are enclosed in square brackets, e.g. `[index]`
* Additional optional arguments are indicated by three period characters, i.e. `...`
* The pipe character, `|`, means an exclusive or
This file has been truncated. show original
@harry RedisJSON doesn’t have such functionality but it sounds very interesting.
Can you please describe your use case?
harry
September 18, 2020, 2:40pm
4
My use case is more for merging two or more json document, especially if you are storing inter-related documents in redisjson. Instead of fetching/joining multiple docs in the applications it would help reduce complexity in the applications greatly.
I understand this can probably be done via lua scripting (using cjson library), but wondering if there is a native or better way.