I prefer using Enum.Map
, however I am having some difficulties making it work since the expected structure for books
should remain like this:
%Scrivener.Page{
entries: [
%Mango.Books.Book{
__meta__: #Ecto.Schema.Metadata<:loaded, "books">,
author: "jxhfkj s",
code: 1130,
id: 120,
inserted_at: ~N[2018-05-11 08:55:59.777576],
institute_id: 1,
isbn: "dsafsafsd",
title: "fdjfh",
updated_at: ~N[2018-05-11 08:55:59.777593],
year: 1980
},
%Mango.Books.Book{
__meta__: #Ecto.Schema.Metadata<:loaded, "books">,
author: "eee",
code: 1129,
id: 119,
inserted_at: ~N[2018-05-10 12:21:16.732606],
institute_id: 1,
isbn: "eeee",
title: "eeee",
updated_at: ~N[2018-05-10 12:21:16.732619],
year: 232
},
%Mango.Books.Book{
__meta__: #Ecto.Schema.Metadata<:loaded, "books">,
author: "bbb",
code: 1128,
id: 118,
inserted_at: ~N[2018-05-09 20:48:31.292419],
institute_id: 1,
isbn: "56465456465",
title: "aaaa",
updated_at: ~N[2018-05-09 20:48:31.292435],
year: 1980
}
],
page_number: 1,
page_size: 20,
total_entries: 15,
total_pages: 1
}
I have tired to make some self-learning, but so far no results, only errors
. Books are nested under entries.