values);
/**
- * Adds an entry to the specified stream.
+ * Adds an entry to the specified stream stored at key
.
+ * If the key
doesn't exist, the stream is created.
*
* @see redis.io for details.
* @param key The key of the stream.
* @param values Field-value pairs to be added to the entry.
* @param options Stream add options.
- * @return The id of the added entry, or null
if {@link StreamAddOptions#makeStream}
- * is set to false
and no stream with the matching key
exists.
+ * @return The id of the added entry, or null
if {@link
+ * StreamAddOptionsBuilder#makeStream(Boolean)} is set to false
and no stream
+ * with the matching key
exists.
* @example
* {@code
* // Option to use the existing stream, or return null if the stream doesn't already exist at "key"
diff --git a/java/client/src/main/java/glide/api/models/BaseTransaction.java b/java/client/src/main/java/glide/api/models/BaseTransaction.java
index a467e5bdf6..43d083c9fb 100644
--- a/java/client/src/main/java/glide/api/models/BaseTransaction.java
+++ b/java/client/src/main/java/glide/api/models/BaseTransaction.java
@@ -93,6 +93,7 @@
import glide.api.models.commands.SetOptions.ConditionalSet;
import glide.api.models.commands.SetOptions.SetOptionsBuilder;
import glide.api.models.commands.StreamAddOptions;
+import glide.api.models.commands.StreamAddOptions.StreamAddOptionsBuilder;
import glide.api.models.commands.ZaddOptions;
import java.util.Map;
import lombok.Getter;
@@ -1533,7 +1534,8 @@ public T zmscore(@NonNull String key, @NonNull String[] members) {
}
/**
- * Adds an entry to the specified stream.
+ * Adds an entry to the specified stream stored at key
.
+ * If the key
doesn't exist, the stream is created.
*
* @see redis.io for details.
* @param key The key of the stream.
@@ -1546,15 +1548,16 @@ public T xadd(@NonNull String key, @NonNull Map values) {
}
/**
- * Adds an entry to the specified stream.
+ * Adds an entry to the specified stream stored at key
.
+ * If the key
doesn't exist, the stream is created.
*
* @see redis.io for details.
* @param key The key of the stream.
* @param values Field-value pairs to be added to the entry.
* @param options Stream add options.
* @return Command Response - The id of the added entry, or null
if {@link
- * StreamAddOptions#makeStream} is set to false
and no stream with the matching
- * key
exists.
+ * StreamAddOptionsBuilder#makeStream(Boolean)} is set to false
and no stream
+ * with the matching key
exists.
*/
public T xadd(
@NonNull String key, @NonNull Map values, @NonNull StreamAddOptions options) {
diff --git a/java/client/src/main/java/glide/api/models/commands/StreamAddOptions.java b/java/client/src/main/java/glide/api/models/commands/StreamAddOptions.java
index 1c3e1c336e..34509523ed 100644
--- a/java/client/src/main/java/glide/api/models/commands/StreamAddOptions.java
+++ b/java/client/src/main/java/glide/api/models/commands/StreamAddOptions.java
@@ -4,11 +4,12 @@
import glide.api.commands.StreamBaseCommands;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import lombok.Builder;
import lombok.NonNull;
/**
- * Optional arguments to {@link StreamBaseCommands#xadd}
+ * Optional arguments to {@link StreamBaseCommands#xadd(String, Map, StreamAddOptions)}
*
* @see redis.io
*/
diff --git a/node/src/BaseClient.ts b/node/src/BaseClient.ts
index 220f8c3e57..c2a36c8b96 100644
--- a/node/src/BaseClient.ts
+++ b/node/src/BaseClient.ts
@@ -2056,7 +2056,7 @@ export class BaseClient {
}
/**
- * Adds an entry to the specified stream.
+ * Adds an entry to the specified stream stored at `key`. If the `key` doesn't exist, the stream is created.
* See https://redis.io/commands/xadd/ for more details.
*
* @param key - The key of the stream.
@@ -2072,12 +2072,12 @@ export class BaseClient {
}
/**
- * Trims the stream by evicting older entries.
+ * Trims the stream stored at `key` by evicting older entries.
* See https://redis.io/commands/xtrim/ for more details.
*
* @param key - the key of the stream
* @param options - options detailing how to trim the stream.
- * @returns The number of entries deleted from the stream.
+ * @returns The number of entries deleted from the stream. If `key` doesn't exist, 0 is returned.
*/
public xtrim(key: string, options: StreamTrimOptions): Promise {
return this.createWritePromise(createXtrim(key, options));
diff --git a/node/src/Transaction.ts b/node/src/Transaction.ts
index b2fbdef317..6b118f57d6 100644
--- a/node/src/Transaction.ts
+++ b/node/src/Transaction.ts
@@ -1174,7 +1174,7 @@ export class BaseTransaction> {
}
/**
- * Adds an entry to the specified stream.
+ * Adds an entry to the specified stream stored at `key`. If the `key` doesn't exist, the stream is created.
* See https://redis.io/commands/xadd/ for more details.
*
* @param key - The key of the stream.
@@ -1190,12 +1190,12 @@ export class BaseTransaction> {
}
/**
- * Trims the stream by evicting older entries.
+ * Trims the stream stored at `key` by evicting older entries.
* See https://redis.io/commands/xtrim/ for more details.
*
* @param key - the key of the stream
* @param options - options detailing how to trim the stream.
- * @returns The number of entries deleted from the stream.
+ * @returns The number of entries deleted from the stream. If `key` doesn't exist, 0 is returned.
*/
public xtrim(key: string, options: StreamTrimOptions): T {
return this.addAndReturn(createXtrim(key, options));