Closed brianfay closed 5 years ago
my hacky local workaround for this is to thread the response through:
(defn- wrap-pipeline-resp
[car-resp]
(cond-> car-resp
(some (complement vector?) car-resp)
vector))
Hi Brian,
Thanks for the report. That would be a bug, but I don't appear to be able to reproduce:
(wcar {} (hset "example3" "foo" "bar")) ; => 1
(wcar {} :as-pipeline (hgetall "example3")) ; => [["foo" "bar"]]
Could you mention what version of Carmine you're running? Thanks!
Ah, I see the problem- you've got your argument order wrong:
Try (car/wcar {:host "localhost" :port 6379} :as-pipeline ...)
instead of (car/wcar :as-pipeline {:host "localhost" :port 6379} ...)
.
Closing :-)
Whoops! Sorry for the false report, and thanks for looking into it.
No worries Brian, thanks for checking! 👍
Super minor issue, but I figured I'd bring it up:
hgetall
returns a vector:When using multiple
hgetall
commands in a pipeline, you get a vector of vectors:I have a use case where I'm doing
hgetall
s on a dynamic number of Hashes (one to many). From my understanding the :as-pipeline flag towcar
exists for this use case; this way the response is in the same format no matter how many requests you're making.I would expect that using
:as-pipeline
, the response would be a vector with a vector in it, but instead I'm just getting the usual vector of keys and values.