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
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+
## Our Standards
8
+
9
+
Examples of behavior that contributes to creating a positive environment include:
10
+
11
+
* Using welcoming and inclusive language
12
+
* Being respectful of differing viewpoints and experiences
13
+
* Gracefully accepting constructive criticism
14
+
* Focusing on what is best for the community
15
+
* Showing empathy towards other community members
16
+
17
+
Examples of unacceptable behavior by participants include:
18
+
19
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+
* Trolling, insulting/derogatory comments, and personal or political attacks
21
+
* Public or private harassment
22
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+
## Our Responsibilities
26
+
27
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+
## Scope
32
+
33
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+
## Enforcement
36
+
37
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `redis @ invertase.io`. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+
## Attribution
42
+
43
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
<a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/NodeRedis.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a>
16
+
</p>
17
+
18
+
---
8
19
9
20
This is a complete and feature rich Redis client for node.js. __It supports all
10
21
Redis commands__ and focuses on high performance.
@@ -195,30 +206,11 @@ So please attach the error listener to node_redis.
195
206
196
207
`client` will emit `end` when an established Redis server connection has closed.
197
208
198
-
### "drain" (deprecated)
199
-
200
-
`client` will emit `drain` when the TCP connection to the Redis server has been
201
-
buffering, but is now writable. This event can be used to stream commands in to
202
-
Redis and adapt to backpressure.
203
-
204
-
If the stream is buffering `client.should_buffer` is set to true. Otherwise the
205
-
variable is always set to false. That way you can decide when to reduce your
206
-
send rate and resume sending commands when you get `drain`.
207
-
208
-
You can also check the return value of each command as it will also return the
209
-
backpressure indicator (deprecated). If false is returned the stream had to
210
-
buffer.
211
-
212
209
### "warning"
213
210
214
211
`client` will emit `warning` when password was set but none is needed and if a
215
212
deprecated option / function / similar is used.
216
213
217
-
### "idle" (deprecated)
218
-
219
-
`client` will emit `idle` when there are no outstanding commands that are
220
-
awaiting a response.
221
-
222
214
## redis.createClient()
223
215
If you have `redis-server` running on the same machine as node, then the
224
216
defaults for port and host are probably fine and you don't need to supply any
@@ -242,17 +234,13 @@ __Note:__ Using `'rediss://...` for the protocol in a `redis_url` will enable a
242
234
| port | 6379 | Port of the Redis server |
243
235
| path | null | The UNIX socket string of the Redis server |
244
236
| url | null | The URL of the Redis server. Format: `[redis[s]:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]` (More info avaliable at [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)). |
245
-
| parser | javascript |__Deprecated__ Use either the built-in JS parser [`javascript`]() or the native [`hiredis`]() parser. __Note__`node_redis` < 2.6 uses hiredis as default if installed. This changed in v.2.6.0. |
246
237
| string_numbers | null | Set to `true`, `node_redis` will return Redis number values as Strings instead of javascript Numbers. Useful if you need to handle big numbers (above `Number.MAX_SAFE_INTEGER === 2^53`). Hiredis is incapable of this behavior, so setting this option to `true` will result in the built-in javascript parser being used no matter the value of the `parser` option. |
247
238
| return_buffers | false | If set to `true`, then all replies will be sent to callbacks as Buffers instead of Strings. |
248
239
| detect_buffers | false | If set to `true`, then replies will be sent to callbacks as Buffers. This option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to every command on a client. __Note__: This doesn't work properly with the pubsub mode. A subscriber has to either always return Strings or Buffers. |
249
240
| socket_keepalive | true | If set to `true`, the keep-alive functionality is enabled on the underlying socket. |
250
-
|socket_initialdelay| 0 | Initial Delay in milliseconds, and this will also behave the interval keep alive message sending to Redis. |
241
+
|socket_initial_delay| 0 | Initial Delay in milliseconds, and this will also behave the interval keep alive message sending to Redis. |
251
242
| no_ready_check | false | When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server will not respond to any commands. To work around this, `node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command indicates whether the server is ready for more commands. When ready, `node_redis` emits a `ready` event. Setting `no_ready_check` to `true` will inhibit this check. |
252
243
| enable_offline_queue | true | By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established. Setting `enable_offline_queue` to `false` will disable this feature and the callback will be executed immediately with an error, or an error will be emitted if no callback is specified. |
253
-
| retry_max_delay | null |__Deprecated___Please use `retry_strategy` instead._ By default, every time the client tries to connect and fails, the reconnection delay almost doubles. This delay normally grows infinitely, but setting `retry_max_delay` limits it to the maximum value provided in milliseconds. |
254
-
| connect_timeout | 3600000 |__Deprecated___Please use `retry_strategy` instead._ Setting `connect_timeout` limits the total time for the client to connect and reconnect. The value is provided in milliseconds and is counted from the moment a new client is created or from the time the connection is lost. The last retry is going to happen exactly at the timeout time. Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h has elapsed. |
255
-
| max_attempts | 0 |__Deprecated___Please use `retry_strategy` instead._ By default, a client will try reconnecting until connected. Setting `max_attempts` limits total amount of connection attempts. Setting this to 1 will prevent any reconnect attempt. |
256
244
| retry_unfulfilled_commands | false | If set to `true`, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished. Use this with caution if you use state altering commands (e.g. `incr`). This is especially useful if you use blocking commands. |
257
245
| password | null | If set, client will run Redis auth command on connect. Alias `auth_pass`__Note__`node_redis` < 2.5 must use `auth_pass`|
258
246
| db | null | If set, client will run Redis `select` command on connect. |
@@ -473,12 +461,6 @@ client.hgetall("hosts", function (err, obj) {
473
461
});
474
462
```
475
463
476
-
Output:
477
-
478
-
```js
479
-
{ mjr:'1', another:'23', home:'1234' }
480
-
```
481
-
482
464
### client.hmset(hash, obj[, callback])
483
465
484
466
Multiple values in a hash can be set by supplying an object:
0 commit comments