diff --git a/timestreamdb.js b/timestreamdb.js index ca1eeb7..2d1870b 100644 --- a/timestreamdb.js +++ b/timestreamdb.js @@ -36,10 +36,14 @@ function TimestreamDB(instance, options) { var db = Version(instance, options) - db.ts = function (key) { - return ts(db.versionStream(key, {reverse: true}).pipe(toTimestream())) + db.ts = function (key, options) { + var opts = {reverse: true} + + if (options.start) opts.minVersion = options.start + if (options.until) opts.maxVersion = options.until + return ts(db.versionStream(key, opts).pipe(toTimestream())) } db.timeStream = db.ts return db -} \ No newline at end of file +}