Comments (3)
@hkong Maybe this is what you want to do?
console.log(JSON.parse(await redis.executor.exec("JSON.GET", "rejson")));
Current result (not as expected):
error: TS2345 [ERROR]: Argument of type 'RedisRawReply' is not assignable to parameter of type 'string'.
Type 'StatusReply' is not assignable to type 'string'.
Expected result:
[ "bulk", {"hello":"world"} ]
or
{"hello":"world"}
from redis.
@uki00a Thank you so much for responding. I tried printing the results just now using console.dir
and you are absolutely right!. And as you guessed, I'm parsing the wrong thing. Parsing it this way, now gives me back the object!
let retval = await redis.executor.exec("JSON.GET", "rejson")
let object = console.log(JSON.parse(retval[1] as string));
Thank you so much for your attention!
from redis.
@hkong Thanks for reporting this issue! I tested rejson with [email protected] and it seems to work properly:
import { connect } from "https://deno.land/x/[email protected]/redis.ts";
const redis = await connect({ hostname: "127.0.0.1", port: 6379 });
console.log(await redis.executor.exec("JSON.SET", "rejson", ".", '{"hello": "world"}'));
console.log(await redis.executor.exec("JSON.GET", "rejson"));
Output:
[ "status", "OK" ]
[ "bulk", '{"hello":"world"}' ]
What is the difference between your expected and current behavior?
from redis.
Related Issues (20)
- BulkNil and execArrayReply breaking xread
- PubSub with binary messages HOT 1
- [feat] keepalive feature
- [feat] automatically reconnect when interrupted
- Bug: xrange failed to parse empty string
- deps: import `cluster-key-slot` and `lodash-es` from esm.sh
- Support for RedisJson - JSON.GET
- Support AbortController in a client HOT 1
- Watch vs tx HOT 1
- Subscribe / psubscribe hangs after calling sub.receive() HOT 1
- `Redis.scan` cursor parameter requires a number
- sendCommand api inconsistency HOT 1
- Property 'set' does not exist on type 'Redis'.deno-ts(2339) HOT 5
- Parallel Request Issue HOT 1
- Subscribe, unsubscribe, resubscribe HOT 4
- feat: Auto-pipelining
- feat: Connection pooling
- Errors on concurrent pipeline invocation HOT 3
- Sentinel Support
- Hang up on auto reconnect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis.