Skip to content

[Doc] Fix Node.js console.log output #2974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged

Conversation

JCornat
Copy link

@JCornat JCornat commented May 25, 2025

Description

This is not much, but reading the Node.js documentation, I saw the console.log output should be 0 instead of an array

@JCornat JCornat changed the title Fix Node.js console.log output [Doc] Fix Node.js console.log output May 25, 2025
@nkaradzhov
Copy link
Collaborator

@JCornat im not sure what you mean, but if you actually run the file, the output is [ 'Deimos', { crashes: 0 }, null ].

@nkaradzhov nkaradzhov closed this May 27, 2025
@JCornat
Copy link
Author

JCornat commented May 27, 2025

@nkaradzhov

When reading the documentation on the website, the others languages return 0

You can see it here : https://redis.io/docs/latest/develop/data-types/json/

Here some screenshots :

Screenshot from 2025-05-27 16-33-49
Screenshot from 2025-05-27 16-37-10
Screenshot from 2025-05-27 16-36-59

To me, sending the command await client.json.get("newbike", "$[1].crashes"); returnes the value 0, not [ 'Deimos', { crashes: 0 }, null ]

@nkaradzhov
Copy link
Collaborator

@JCornat you are totally right. In fact, it looks like the examples are wrong because the path should be provided as an object and not as a string const res13 = await client.json.get('newbike', { path: '$[1].crashes' }); . So, thanks for flagging this issue! I will fix the path param issue in another PR

@nkaradzhov nkaradzhov reopened this May 27, 2025
@nkaradzhov nkaradzhov merged commit 7c4f0ea into redis:emb-examples May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants