You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Data
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime Added { get; set; }
}
In the redis, I have one key for which I am storing List.
In case to insert a single data record I was using length to store new data record and was using JSONPATH.
Below is the JSONPATH var serializedRedisData = JsonConvert.SerializeObject(data); _database.JsonSet(redisKey, serializedRedisData, ".[(@.length)]");
Below is my json string
[{"Id":1,"Name":"first value","Added":"2022-06-15T09:48:36.7132436Z"},{"Id":2,"Name":"second value","Added":"2022-06-15T09:48:36.7132479Z"},{"Id":3,"Name":"third value","Added":"2022-06-15T09:48:36.713248Z"}]
And the structure is:
In the redis, I have one key for which I am storing List.
In case to insert a single data record I was using length to store new data record and was using JSONPATH.
Below is the JSONPATH
var serializedRedisData = JsonConvert.SerializeObject(data);
_database.JsonSet(redisKey, serializedRedisData, ".[(@.length)]");
But getting below error:
StackExchange.Redis.RedisServerException: 'JSON Path error: path error: \n$.[(@.length)]\n^^^^^\n'
The text was updated successfully, but these errors were encountered: