@@ -213,6 +213,79 @@ public interface RedisTimeSeriesCommands {
213213 */
214214 List <TSElement > tsRead (String key , TSReadParams readParams );
215215
216+ /**
217+ * <b><a href="https://redis.io/commands/ts.nrange">TS.NRANGE Command</a></b>
218+ * <p>
219+ * Queries an explicit list of time series over a timestamp range and returns a timestamp-major
220+ * response in forward (increasing timestamp) order. Each returned {@link TSElement} carries one
221+ * value per key, in the order the keys were passed; a key with no sample at a row timestamp is
222+ * surfaced as {@code NaN} (indistinguishable from a stored or aggregated {@code NaN}). Key order
223+ * and duplicate keys are significant and are preserved.
224+ * <p>
225+ * All keys must map to the same hash slot in a cluster; this is treated as a single-shard,
226+ * key-routed command and is not split across shards.
227+ * <p>
228+ * Time complexity: O(numkeys*(n/m+k)) where n = number of samples, m = chunk size, k = number of
229+ * samples in the requested range.
230+ *
231+ * @param keys explicit time series keys, in output column order (duplicates allowed)
232+ * @param fromTimestamp inclusive range start
233+ * @param toTimestamp inclusive range end
234+ * @return one pivot row per distinct timestamp, in increasing-timestamp order
235+ * @since 8.0
236+ */
237+ List <TSElement > tsNRange (String [] keys , long fromTimestamp , long toTimestamp );
238+
239+ /**
240+ * <b><a href="https://redis.io/commands/ts.nrange">TS.NRANGE Command</a></b>
241+ * <p>
242+ * {@code TS.NRANGE numkeys key [key ...] fromTimestamp toTimestamp
243+ * [LATEST]
244+ * [FILTER_BY_TS ts...]
245+ * [FILTER_BY_VALUE min max]
246+ * [COUNT count]
247+ * [[ALIGN align] AGGREGATION aggregator [aggregator ...] bucketDuration [BUCKETTIMESTAMP bt] [EMPTY]]}
248+ * <p>
249+ * In aggregation mode exactly one aggregator token is emitted per key (see
250+ * {@link TSNRangeParams#aggregation(AggregationType[], long)} and
251+ * {@link TSNRangeParams#aggregation(AggregationType[][], long)}); the server rejects a mismatch
252+ * between the number of aggregator tokens and {@code numkeys}. Missing raw samples and missing
253+ * aggregation buckets are surfaced as {@code NaN}.
254+ *
255+ * @param keys explicit time series keys, in output column order (duplicates allowed)
256+ * @param nrangeParams optional range arguments (including {@code fromTimestamp}/{@code toTimestamp})
257+ * @return one pivot row per distinct timestamp, in increasing-timestamp order
258+ * @since 8.0
259+ */
260+ List <TSElement > tsNRange (String [] keys , TSNRangeParams nrangeParams );
261+
262+ /**
263+ * <b><a href="https://redis.io/commands/ts.nrevrange">TS.NREVRANGE Command</a></b>
264+ * <p>
265+ * Reverse variant of {@link #tsNRange(String[], long, long)}: identical semantics but rows are
266+ * returned in decreasing-timestamp order. Server-returned order is preserved as-is.
267+ *
268+ * @param keys explicit time series keys, in output column order (duplicates allowed)
269+ * @param fromTimestamp inclusive range start
270+ * @param toTimestamp inclusive range end
271+ * @return one pivot row per distinct timestamp, in decreasing-timestamp order
272+ * @since 8.0
273+ */
274+ List <TSElement > tsNRevRange (String [] keys , long fromTimestamp , long toTimestamp );
275+
276+ /**
277+ * <b><a href="https://redis.io/commands/ts.nrevrange">TS.NREVRANGE Command</a></b>
278+ * <p>
279+ * Reverse variant of {@link #tsNRange(String[], TSNRangeParams)}: identical semantics and options
280+ * but rows are returned in decreasing-timestamp order. Server-returned order is preserved as-is.
281+ *
282+ * @param keys explicit time series keys, in output column order (duplicates allowed)
283+ * @param nrangeParams optional range arguments (including {@code fromTimestamp}/{@code toTimestamp})
284+ * @return one pivot row per distinct timestamp, in decreasing-timestamp order
285+ * @since 8.0
286+ */
287+ List <TSElement > tsNRevRange (String [] keys , TSNRangeParams nrangeParams );
288+
216289 /**
217290 * {@code TS.MRANGE fromTimestamp toTimestamp FILTER filter...}
218291 *
0 commit comments