diff --git a/docs/api/redis.md b/docs/api/redis.md index 3c663cb0a0..934e6d7b4b 100644 --- a/docs/api/redis.md +++ b/docs/api/redis.md @@ -132,6 +132,10 @@ await redis.hmset("user:123", [ const userFields = await redis.hmget("user:123", ["name", "email"]); console.log(userFields); // ["Alice", "alice@example.com"] +// Get single field from hash (returns value directly, null if missing) +const userName = await redis.hget("user:123", "name"); +console.log(userName); // "Alice" + // Increment a numeric field in a hash await redis.hincrby("user:123", "visits", 1); diff --git a/docs/api/websockets.md b/docs/api/websockets.md index 075439ade3..2dc6cdab2e 100644 --- a/docs/api/websockets.md +++ b/docs/api/websockets.md @@ -279,6 +279,9 @@ Bun implements the `WebSocket` class. To create a WebSocket client that connects ```ts const socket = new WebSocket("ws://localhost:3000"); + +// With subprotocol negotiation +const socket2 = new WebSocket("ws://localhost:3000", ["soap", "wamp"]); ``` In browsers, the cookies that are currently set on the page will be sent with the WebSocket upgrade request. This is a standard feature of the `WebSocket` API. diff --git a/docs/cli/run.md b/docs/cli/run.md index 80a00b2f93..ec31355724 100644 --- a/docs/cli/run.md +++ b/docs/cli/run.md @@ -166,6 +166,14 @@ will execute `