You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to retrieve the total count of customers. According to the documentation for the upstream Stripe API,
You can optionally request that the response include the total count of all
customers that match your filters. To do so, specify include[]=total_count in
your request.
However, I couldn't figure out if this is possible using Elephant and the clojurewerkz.elephant.customers/list function. I tried using (ecr/list {"include[]" "total_count"}) but, as the result is always a plain sequence of customer maps, the count was not accessible.
The text was updated successfully, but these errors were encountered:
Elephant returns the JSON objects as they are returned (it does inject a couple of fields for its own use but they are clearly prefixed). I cannot say how to do it without running an experiment.
Although Elephant does return the untouched JSON for each individual customer, there are additional fields in the JSON at the top-level -- that is, calling .getData() on the CustomerCollection descends one level. .getTotalCount would also be possible directly on the CustomerCollection, but Elephant hides that. Seems quite technically simple to add, but quite disruptive to the interface in general. :/
It's a pre-1.0 library. @amoe feel free to submit a PR. It's also possible to have data structures in Clojure that look and work like maps but are actually Java classes. I hope we can avoid it here but if we want to make something look like a map for all intents and purposes, we can do that.
I wanted to retrieve the total count of customers. According to the documentation for the upstream Stripe API,
However, I couldn't figure out if this is possible using Elephant and the
clojurewerkz.elephant.customers/list
function. I tried using(ecr/list {"include[]" "total_count"})
but, as the result is always a plain sequence of customer maps, the count was not accessible.The text was updated successfully, but these errors were encountered: