NReJSON/DatabaseExtensions.cs
/// <summary>
/// `JSON.SET`
/// 
/// Sets the JSON value at path in key
///
/// For new Redis keys the path must be the root. 
/// 
/// For existing keys, when the entire path exists, the value that it contains is replaced with the json value.
/// 
/// https://oss.redislabs.com/rejson/commands/#jsonset
/// </summary>
/// <param name="db"></param>
/// <param name="key">Key where JSON object is to be stored.</param>
/// <param name="json">The JSON object which you want to persist.</param>
/// <param name="path">The path which you want to persist the JSON object. For new objects this must be root.</param>
/// <param name="setOption">By default the object will be overwritten, but you can specify that the object be set only if it doesn't already exist or to set only IF it exists.</param>
/// <param name="index">By default the JSON object will not be assigned to an index, specify this value and it will.</param>
/// <returns>An `OperationResult` indicating success or failure.</returns>


Sets the JSON value at path in key

For new Redis keys the path must be the root.

For existing keys, when the entire path exists, the value that it contains is replaced with the json value.


Sets the JSON value at path in key For new Redis keys the path must be the root . For existing keys when the entire path exists the value that it contains is replaced with the json value .
public static OperationResult JsonSet(this IDatabase db, RedisKey key, string json, string path = ".", SetOption setOption = SetOption.Default, string index = "")
        {
            var result = db.Execute(JsonCommands.SET, CombineArguments(key, path, json, GetSetOptionString(setOption), ResolveIndexSpecification(index))).ToString();
            return new OperationResult(result == "OK", result);
        }
public static OperationResult JsonSet ( this IDatabase db , RedisKey key , string json , string path = " " , SetOption setOption = SetOption . Default , string index = " " ) { var result = db . Execute ( JsonCommands . SET , CombineArguments ( key , path , json , GetSetOptionString ( setOption ) , ResolveIndexSpecification ( index ) ) ) . ToString ( ) ; return new OperationResult ( result == " " , result ) ; }
`JSON.SET`
` JSON . SET `
An `OperationResult` indicating success or failure.
An ` OperationResult ` indicating success or failure .
IDatabase
this
key
RedisKey
Key where JSON object is to be stored.
Key where JSON object is to be stored .
json
string
The JSON object which you want to persist.
The JSON object which you want to persist .
path
string
The path which you want to persist the JSON object. For new objects this must be root.
The path which you want to persist the JSON object . For new objects this must be root .
setOption
SetOption
By default the object will be overwritten, but you can specify that the object be set only if it doesn't already exist or to set only IF it exists.
By default the object will be overwritten but you can specify that the object be set only if it doesn ' t already exist or to set only IF it exists .
index
string
By default the JSON object will not be assigned to an index, specify this value and it will.
By default the JSON object will not be assigned to an index specify this value and it will .
db
None