Last active
January 15, 2016 21:13
-
-
Save dfcarpenter/fcd648c23187d9eb5fa3 to your computer and use it in GitHub Desktop.
Elixir service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Users.newusers | |
|> elem(1) | |
|> Map.get("Items") | |
|> Poison.encode | |
|> elem(1) | |
|> File.write("/dir/users.json") | |
#response from dynamodb after first function | |
{:ok, | |
%{"Count" => 691, | |
"Items" => [%{"accountStatus" => %{"S" => "active"}, | |
"createdDate" => %{"N" => "1452199374896"}, | |
"emailAddress" => %{"S" => "test@email.com"}, | |
"fullName" => %{"S" => "Tim Madams"}, | |
"userId" => %{"S" => "b0aaa703093deeb4b68275a801db5940"}}, | |
%{"accountStatus" => %{"S" => "active"}, | |
"createdDate" => %{"N" => "1452203121748"}, | |
"emailAddress" => %{"S" => "test@email.com"}, | |
"fullName" => %{"S" => "kc"}, | |
"userId" => %{"S" => "3dc9b67a039c4af061cfd9b505cd5bcf"}}, | |
%{"accountStatus" => %{"S" => "active"}, | |
"createdDate" => %{"N" => "1452204318593"}, | |
"emailAddress" => %{"S" => "test@email.com"}, | |
"fullName" => %{"S" => "Fernando"}, | |
"userId" => %{"S" => "91e63f80a8d7e9cb4692d1b26bce7cfd"}}, | |
%{"accountStatus" => %{"S" => "active"}, | |
"createdDate" => %{"N" => "1452208426812"}, | |
"emailAddress" => %{"S" => "test@email.com"}}]}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should work. You are currently piping the json in as the first argument of File.write and it's trying to use the json as the file name