Socket
Socket
Sign inDemoInstall

@redis/json

Package Overview
Dependencies
4
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

dist/commands/MERGE.d.ts

8

dist/commands/index.d.ts

@@ -11,3 +11,5 @@ import * as ARRAPPEND from './ARRAPPEND';

import * as GET from './GET';
import * as MERGE from './MERGE';
import * as MGET from './MGET';
import * as MSET from './MSET';
import * as NUMINCRBY from './NUMINCRBY';

@@ -43,4 +45,8 @@ import * as NUMMULTBY from './NUMMULTBY';

get: typeof GET;
MERGE: typeof MERGE;
merge: typeof MERGE;
MGET: typeof MGET;
mGet: typeof MGET;
MSET: typeof MSET;
mSet: typeof MSET;
NUMINCRBY: typeof NUMINCRBY;

@@ -72,3 +78,3 @@ numIncrBy: typeof NUMINCRBY;

}
export declare type RedisJSON = null | boolean | number | string | Date | RedisJSONArray | RedisJSONObject;
export type RedisJSON = null | boolean | number | string | Date | RedisJSONArray | RedisJSONObject;
export declare function transformRedisJsonArgument(json: RedisJSON): string;

@@ -75,0 +81,0 @@ export declare function transformRedisJsonReply(json: string): RedisJSON;

@@ -14,3 +14,5 @@ "use strict";

const GET = require("./GET");
const MERGE = require("./MERGE");
const MGET = require("./MGET");
const MSET = require("./MSET");
const NUMINCRBY = require("./NUMINCRBY");

@@ -46,4 +48,8 @@ const NUMMULTBY = require("./NUMMULTBY");

get: GET,
MERGE,
merge: MERGE,
MGET,
mGet: MGET,
MSET,
mSet: MSET,
NUMINCRBY,

@@ -50,0 +56,0 @@ numIncrBy: NUMINCRBY,

2

dist/commands/RESP.d.ts
export declare const FIRST_KEY_INDEX = 1;
export declare function transformArguments(key: string, path?: string): Array<string>;
declare type RESPReply = Array<string | number | RESPReply>;
type RESPReply = Array<string | number | RESPReply>;
export declare function transformReply(): RESPReply;
export {};
export declare const FIRST_KEY_INDEX = 1;
declare type AppendArguments = [key: string, append: string];
declare type AppendWithPathArguments = [key: string, path: string, append: string];
type AppendArguments = [key: string, append: string];
type AppendWithPathArguments = [key: string, path: string, append: string];
export declare function transformArguments(...[key, pathOrAppend, append]: AppendArguments | AppendWithPathArguments): Array<string>;
export declare function transformReply(): number | Array<number>;
export {};
{
"name": "@redis/json",
"version": "1.0.4",
"version": "1.0.5",
"license": "MIT",

@@ -21,10 +21,22 @@ "main": "./dist/index.js",

"@redis/test-utils": "*",
"@types/node": "^18.7.10",
"@types/node": "^20.6.2",
"nyc": "^15.1.0",
"release-it": "^15.3.0",
"release-it": "^16.1.5",
"source-map-support": "^0.5.21",
"ts-node": "^10.9.1",
"typedoc": "^0.23.10",
"typescript": "^4.7.4"
}
"typedoc": "^0.25.1",
"typescript": "^5.2.2"
},
"repository": {
"type": "git",
"url": "git://github.com/redis/node-redis.git"
},
"bugs": {
"url": "https://github.com/redis/node-redis/issues"
},
"homepage": "https://github.com/redis/node-redis/tree/master/packages/json",
"keywords": [
"redis",
"RedisJSON"
]
}
# @redis/json
This package provides support for the [RedisJSON](https://redisjson.io) module, which adds JSON as a native data type to Redis. It extends the [Node Redis client](https://github.com/redis/node-redis) to include functions for each of the RedisJSON commands.
This package provides support for the [RedisJSON](https://redis.io/docs/stack/json/) module, which adds JSON as a native data type to Redis. It extends the [Node Redis client](https://github.com/redis/node-redis) to include functions for each of the RedisJSON commands.

@@ -13,3 +13,3 @@ To use these extra commands, your Redis server must have the RedisJSON module installed.

The [`JSON.SET`](https://oss.redis.com/redisjson/commands/#jsonset) command stores a JSON value at a given JSON Path in a Redis key.
The [`JSON.SET`](https://redis.io/commands/json.set/) command stores a JSON value at a given JSON Path in a Redis key.

@@ -41,7 +41,7 @@ Here, we'll store a JSON document in the root of the Redis key "`mydoc`":

For more information about RedisJSON's path syntax, [check out the documentation](https://oss.redis.com/redisjson/path/).
For more information about RedisJSON's path syntax, [check out the documentation](https://redis.io/docs/stack/json/path/).
### Retrieving JSON Documents from Redis
With RedisJSON, we can retrieve all or part(s) of a JSON document using the [`JSON.GET`]() command and one or more JSON Paths. Let's get the name and age of one of the pets:
With RedisJSON, we can retrieve all or part(s) of a JSON document using the [`JSON.GET`](https://redis.io/commands/json.get/) command and one or more JSON Paths. Let's get the name and age of one of the pets:

@@ -67,3 +67,3 @@ ```javascript

Using the [`JSON.NUMINCRBY`](https://oss.redis.com/redisjson/commands/#jsonnumincrby) command, we can update the age of one of the pets like this:
Using the [`JSON.NUMINCRBY`](https://redis.io/commands/json.numincrby/) command, we can update the age of one of the pets like this:

@@ -74,11 +74,11 @@ ```javascript

And we can add a new object to the pets array with the [`JSON.ARRAPPEND`](https://oss.redis.com/redisjson/commands/#jsonarrappend) command:
And we can add a new object to the pets array with the [`JSON.ARRAPPEND`](https://redis.io/commands/json.arrappend/) command:
```javascript
await client.json.arrAppend('noderedis:jsondata', '.pets', {
name: 'Robin',
species: 'bird',
age: 1,
isMammal: false
});
await client.json.arrAppend('noderedis:jsondata', '.pets', {
name: 'Robin',
species: 'bird',
age: 1,
isMammal: false
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc