1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-01 16:46:54 +03:00
Commit Graph

100 Commits

Author SHA1 Message Date
2c9ad2e772 chore(examples): fix examples for v5 (#2938) 2025-05-05 11:35:41 +03:00
b2d35c5286 V5 bringing RESP3, Sentinel and TypeMapping to node-redis
RESP3 Support
   - Some commands responses in RESP3 aren't stable yet and therefore return an "untyped" ReplyUnion.
 
Sentinel

TypeMapping

Correctly types Multi commands

Note: some API changes to be further documented in v4-to-v5.md
2024-10-15 17:46:52 +03:00
01ca54e907 fix #1970 - add support for RESTORE (#2535)
* - Added RESTORE functionality

* add FIRST_KEY_INDEX, fix tests, clean example, add example to examples table

* use returnBuffers in test

---------

Co-authored-by: Leibale Eidelman <me@leibale.com>
2023-09-18 19:45:33 -04:00
499ea85594 Update search-hashes.js (#2519) 2023-05-29 07:18:59 -04:00
1be84228b5 Remove redundant UNF sub-option in JSON example (#2418)
UNF option is not required with JSON and makes the 
example harder to read and understand.
2023-02-21 10:45:48 -05:00
abf2b4bc82 update examples/README.md - add search-knn to the table 2023-01-18 14:36:57 -05:00
fa47b572d4 Adds example for mixing arbitrary and supported commands in a transaction context. (#2315)
* Adds example for transactions with arbitrary commands.

* Formatting.

* Update transaction-with-arbitrary-commands.js

Co-authored-by: Leibale Eidelman <me@leibale.com>
2023-01-18 12:59:04 -05:00
2042a67f3c KNN example (#2352)
* Sketch KNN example

* Got KNN example to work. Closes #2351

* clean example

Co-authored-by: Leibale Eidelman <me@leibale.com>
2023-01-18 12:54:51 -05:00
da3face951 Add connection status check example and documentation. (#2340)
* Adds example for transactions with arbitrary commands.

* Formatting.

* Adds isReady doc and example for isReady and isOpen.

* Improved example.

* Added isOpen explanation.

* Removed example from a different PR.
2022-12-13 15:19:45 -05:00
5a25078831 Update search-json.js (#2317) 2022-10-31 09:44:30 -04:00
64e982d2bf Adds transaction with watched key example script. (#2297)
* transction example improved

* readme fixed

* delay added for watched key changes

* pooling error fixed on recursion

* Minor comment update.

Co-authored-by: Ajay <ajay.markana@yudiz.com>
Co-authored-by: Simon Prickett <simon@redis.com>

Closes #2280.
2022-10-19 17:50:57 +01:00
1eed12ec65 Connecting to cluster example (#2298)
* Connecting to cluster example

* Connecting to cluster example

* Making changes according to review

* Adding example to Readme.md in alphabetical order

* Fixed order of scripts so they are alphabetic.

Co-authored-by: Simon Prickett <simon@redis.com>

Closes #2281.
2022-10-19 13:02:07 +01:00
d0bfa771a8 #2287 Add example scripts showing pub/sub usage. (#2288)
* #2287 Add example scripts showing pub/sub usage.
https://github.com/redis/node-redis/issues/2287

* #2287 Add example scripts showing pub/sub usage.
Fixing comments requested
Adding client.connect() to pubsub-subscriber.js
Reformatting Readme
updating logging in pubsub-publisher.js

* #2287 Add example scripts showing pub/sub usage.
Fix publish and subscriber
Update tidy up comments

* Update examples/pubsub-subscriber.js

Making suggested changes

Co-authored-by: Simon Prickett <simon@crudworks.org>

Co-authored-by: Simon Prickett <simon@crudworks.org>

Closes #2287.
2022-10-14 23:07:28 +01:00
9398e5d05e #2285-Add-example-scripts-hyperloglog - Added hyperloglog examples to… (#2289)
* #2285-Add-example-scripts-hyperloglog - Added hyperloglog examples to address Issue #2285

* #2285-Add-example-scripts-hyperloglog - Added the results as comments

* #2285-Add-example-scripts-hyperloglog - Changes from review

* #2285-Add-example-scripts-hyperloglog - Changes from review
2022-10-14 20:34:06 +01:00
f3462abf33 Updates examples. (#2219)
* Updates examples.

* Added command link for hset.
2022-08-15 08:39:28 -04:00
5fefcca8df Fixed a small typo. (#2168) 2022-06-30 12:53:26 -04:00
e1c13f874a Fixed erroneous reference to Top-K (#2158) 2022-06-15 15:18:36 -04:00
f269319f42 Updated search example to show sorting. (#2148)
* Updated search example to show sorting.

* Fixed example response.
2022-05-26 09:57:08 -04:00
0752f143a6 prepare 4.1.0 (#2111)
* increase test coverage

* @node-redis to @redis

* ugprade deps

* fix benchmark

* use 7.0 docker (not rc), update readmes, clean code, fix @-redis import

* update readme

* fix function in cluster

* update docs

Co-authored-by: Chayim <chayim@users.noreply.github.com>

* Update clustering.md

* add subpackages move warning

* drop support for node 12

* upgrade deps

* fix tsconfig.base.json

Co-authored-by: Chayim <chayim@users.noreply.github.com>
2022-05-02 11:48:12 -04:00
225524fabf Adds example of using a trim strategy with XADD. (#2105)
* Adds example of using a trim strategy with XADD.

* Update stream-producer.js

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-04-26 14:04:44 +01:00
0f7ae937df Updates topk example for new withcount option. (#2093) 2022-04-25 05:58:24 -04:00
bae54f19be Adds example of how to escape punctuation when searching. (#2027)
* Adds example of how to escape punctuation when searching.

* Optimized regex.
2022-03-10 11:22:22 -05:00
88586048e1 Fixes the time command response. (#2008)
* Fixes the time command response.

* Adds TIME example.

* Update TIME.ts

* Update get-server-time.js

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-03-07 07:20:19 -05:00
ac7d50c731 Added sorted set example. (#2005)
* Added sorted set example.

* Update sorted-set.js

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-02-24 18:04:06 -05:00
9f0f7f5215 Minor formatting fix. (#1890) 2022-02-03 06:43:36 -05:00
41f6b009d3 Add streams XREADGROUP and XACK example. (#1832)
* Removed stream delete command to allow consumer group example to work.

* Adds stream consumer group example.

* Adds stream consumer group example code.

* Update README.md

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-19 13:36:24 -05:00
d602682b64 Adding a RedisTimeSeries example (#1839)
* Adds the start of a timeseries example.

* Exports required TimeSeries items.

* Fixed import.

* Added TS.INFO example output.

* Fixed typo.

* Fixed typo.

* Exported aggregation enum.

* Working time series example.

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-19 13:35:18 -05:00
b68836c59f Adds Cuckoo Filter example. (#1843)
Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-19 13:32:20 -05:00
86c239e7e9 Adds a basic count-min sketch example for RedisBloom. (#1842) 2022-01-19 13:30:41 -05:00
06cb63756c Adds Bloom Filter example using RedisBloom. (#1835)
* Adds Bloom Filter example using RedisBloom.

* Update bloom-filter.js

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-15 11:47:47 -05:00
e4601b6960 Adds topk example for RedisBloom (#1837)
* Adds topk example.

* Update topk.js

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-15 11:44:53 -05:00
8a40398a75 Update stream-consumer.js 2022-01-13 12:01:41 -05:00
309cdbdd7c Add stream examples. (#1830)
* Adds stream consumer and producer scripts to doc.

* Updated build command example.

* Adds stream producer example.

* Adds basic stream consumer example.

* Added isolated execution.

* Update README.md

* Update stream-consumer.js

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
2022-01-13 11:57:03 -05:00
96a73db0b4 fix merge 2021-11-24 21:27:04 -05:00
bf8fb65caa Merge branch 'v4.0' of github.com:redis/node-redis 2021-11-24 21:23:35 -05:00
07a98c8240 Added missing pet name. 2021-11-24 21:37:37 +00:00
862b9a132e Fixed search example for JSON. 2021-11-24 20:40:17 +00:00
7d58f05479 Some refactoring. 2021-11-24 20:03:23 +00:00
99b261b79c Renamed JSON search example. 2021-11-24 19:40:20 +00:00
055af50890 Adds RedisJSON example. 2021-11-24 19:32:37 +00:00
967ee5801c Made top level comment more descriptive. 2021-11-24 18:16:59 +00:00
13714e69ba Adds RediSearch demo. 2021-11-23 21:39:05 +00:00
eedce53b15 Fixed a few typos. 2021-11-17 19:42:57 +00:00
eed479778f v4.0.0-rc.4 (#1723)
* update workflows & README

* add .deepsource.toml

* fix client.quit, add error events on cluster, fix some "deepsource.io" warnings

* Release 4.0.0-rc.1

* add cluster.duplicate, add some tests

* fix #1650 - add support for Buffer in some commands, add GET_BUFFER command

* fix GET and GET_BUFFER return type

* update FAQ

* Update invalid code example in README.md (#1654)

* Update invalid code example in README.md

* Update README.md

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>

* fix #1652

* ref #1653 - better types

* better types

* fix 54124793ad

* Update GEOSEARCHSTORE.spec.ts

* fix #1660 - add support for client.HSET('key', 'field', 'value')

* upgrade dependencies, update README

* fix #1659 - add support for db-number in client options url

* fix README, remove unused import, downgrade typedoc & typedoc-plugin-markdown

* update client-configurations.md

* fix README

* add CLUSTER_SLOTS, add some tests

* fix "createClient with url" test with redis 5

* remove unused imports

* Release 4.0.0-rc.2

* add missing semicolon

* replace empty "transformReply" functions with typescript "declare"

* fix EVAL & EVALSHA, add some tests, npm update

* fix #1665 - add ZRANGEBYLEX, ZRANGEBYSCORE, ZRANGEBYSCORE_WITHSCORES

* new issue templates

* add all COMMAND commands

* run COMMAND & COMMAND INFO tests only on redis >6

* Create SECURITY.md

* fix #1671 - add support for all client configurations in cluster

* ref #1671 - add support for defaults

* remove some commands from cluster, npm update, clean code,

* lock benny version

* fix #1674 - remove `isolationPoolOptions` when creating isolated connection

* increase test coverage

* update .npmignore

* Release 4.0.0-rc.3

* fix README

* remove whitespace from LICENSE

* use "export { x as y }" instead of import & const

* move from "NodeRedis" to "Redis"

* fix #1676

* update comments

* Auth before select database (#1679)

* Auth before select database

* fix #1681

Co-authored-by: leibale <leibale1998@gmail.com>

* Adds connect-as-acl-user example. (#1684)

* Adds connect-as-acl-user example.

* Adds blank line at end.

* Set to private.

* Adds examples folder to npmignore.

* Adds Apple .DS_Store file to .gitignore (#1685)

* Adds Apple .DS_Store file.

* Add .DS_Store to .npmignore too

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>

* move examples

* clean some tests

* clean code

* Adds examples table of contents and contribution guidelines. (#1686)

* Updated examples to use named functions. (#1687)

* Updated examples to user named functions.

* Update README.md

Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>

* update docs, add 6.0.x to the tests matrix, add eslint, npm update, fix some commands, fix some types

Co-authored-by: Simon Prickett <simon@crudworks.org>

* fix tests with redis 6.0.x

* fix ACL GETUSER test

* fix client.quit and client.disconnect

* fix ACL GETUSER

* Adds TypeScript note and corrects a typo.

* Fixes a bug in the Scan Iterator section. (#1694)

* Made examples use local version.

* Add `lua-multi-incr.js` example (#1692)

Also fix syntax error in the lua example in the README

Closes #1689.

* Add(examples): Create an example for blPop & lPush (#1696)

* Add(examples): Create an example for blPop & lPush

Signed-off-by: Aditya Rastogi <adit.rastogi2014@gmail.com>

* Update(examples): fix case, add timeout, update readme

Signed-off-by: Aditya Rastogi <adit.rastogi2014@gmail.com>

Closes #1693.

* Add command-with-modifiers.js example (#1695)

* Adds TypeScript note and corrects a typo.

* Adds command-with-modifiers example. (redis#1688)

* Adds command-with-modifiers example. (redis#1688)

* Adds command-with-modifiers example. (redis#1688)

* Removed callbacks.

Co-authored-by: Simon Prickett <simon@redislabs.com>

Closes #1688.

* Issue # 1697 FIX - creates an example script that shows how to use the SSCAN iterator (#1699)

* #1697 fix for set scan example

* adds the js file

* adds comment

* Minor layout and comment adjustment.

Co-authored-by: srawat2 <shashank19aug>
Co-authored-by: Simon Prickett <simon@redislabs.com>

Closes #1697.

* fix #1706 - HSET return type should be number

* use dockers for tests, fix some bugs

* increase dockers timeout to 30s

* release drafter (#1683)

* release drafter

* fixing contributors

* use dockers for tests, use npm workspaces, add rejson & redisearch modules, fix some bugs

* fix #1712 - fix LINDEX return type

* uncomment TIME tests

* use codecov

* fix tests.yml

* uncomment "should handle live resharding" test

* fix #1714 - update README(s)

* add package-lock.json

* update CONTRIBUTING.md

* update examples

* uncomment some tests

* fix test-utils

* move "all-in-one" to root folder

* fix tests workflow

* fix bug in cluster slots, enhance live resharding test

* fix live resharding test

* fix #1707 - handle number arguments in legacy mode

* Add rejectedUnauthorized and other TLS options (#1708)

* Update socket.ts

* fix #1716 - decode username and password from url

* fix some Z (sorted list) commands, increase commands test coverage

* remove empty lines

* fix 'Scenario' typo (#1720)

* update readmes, add createCluster to the `redis` package

* add .release-it.json files, update some md files

* run tests on pull requests too

* Support esModuleInterop set to false. (#1717)

* Support esModuleInterop set to false.

When testing the upcoming 4.x release, we got a bunch of typescript
errors emitted from this project.

We quickly realized this is because the library uses the esModuleInterop
flag. This makes some imports _slightly_ easier to write, but it comes
at a cost: it forces any application or library using this library to
*also* have esModuleInterop on.

The `esModuleInterop` flag is a bit of a holdover from an earlier time,
and I would not recommend using it in libraries. The main issue is that
if it's set to true, you are forcing any users of the library to also
have `esModuleInterop`, where if you keep have it set to `false` (the
default), you leave the decision to the user.

This change should have no rammifications to users with
`esModuleInterop` on, but it will enable support for those that have it
off.

This is especially good for library authors such as myself, because I
would also like to keep this flag off to not force *my* users into this
feature.

* All tests now pass!

* Move @types/redis-parser into client sub-package

and removed a comma

* npm update, remove html from readme

* add tests and licence badges

* update changelog.md

* update .npmignore and .release-it.json

* update .release-it.json

* Release client@1.0.0-rc.0

* revert d32f1edf8a

* fix .npmignore

* replace @redis with @node-redis

* Release client@1.0.0-rc.0

* update json & search version

* Release json@1.0.0-rc.0

* Release search@1.0.0-rc.0

* update dependencies

* Release redis@4.0.0-rc.4

Co-authored-by: Richard Samuelsson <noobtoothfairy@gmail.com>
Co-authored-by: mustard <mhqnwt@gmail.com>
Co-authored-by: Simon Prickett <simon@redislabs.com>
Co-authored-by: Simon Prickett <simon@crudworks.org>
Co-authored-by: Suze Shardlow <SuzeShardlow@users.noreply.github.com>
Co-authored-by: Joshua T <buildingsomethingfun@gmail.com>
Co-authored-by: Aditya Rastogi <adit.rastogi2014@gmail.com>
Co-authored-by: Rohan Kumar <rohan.kr20@gmail.com>
Co-authored-by: Kalki <shashank.kviit@gmail.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
Co-authored-by: Da-Jin Chu <dajinchu@gmail.com>
Co-authored-by: Henrique Corrêa <75134774+HeCorr@users.noreply.github.com>
Co-authored-by: Evert Pot <me@evertpot.com>
2021-11-16 02:48:20 -05:00
38426fe2a4 move "all-in-one" to root folder 2021-11-09 19:55:16 -05:00
3ad8a227eb update examples 2021-11-09 18:24:01 -05:00
ab339d396a fix #1714 - update README(s) 2021-11-09 18:07:26 -05:00
3eb99dbe83 use dockers for tests, use npm workspaces, add rejson & redisearch modules, fix some bugs 2021-11-08 19:21:15 -05:00
d409120e5b Issue # 1697 FIX - creates an example script that shows how to use the SSCAN iterator (#1699)
* #1697 fix for set scan example

* adds the js file

* adds comment

* Minor layout and comment adjustment.

Co-authored-by: srawat2 <shashank19aug>
Co-authored-by: Simon Prickett <simon@redislabs.com>

Closes #1697.
2021-10-27 21:54:12 +01:00
fdffa2383f Add command-with-modifiers.js example (#1695)
* Adds TypeScript note and corrects a typo.

* Adds command-with-modifiers example. (redis#1688)

* Adds command-with-modifiers example. (redis#1688)

* Adds command-with-modifiers example. (redis#1688)

* Removed callbacks.

Co-authored-by: Simon Prickett <simon@redislabs.com>

Closes #1688.
2021-10-27 00:22:19 +01:00