<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="45011" data-post-id="45011">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maliawelli" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maliawelli
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/gregvaughn" rel="nofollow">@gregvaughn</a>:<br>
I can’t use join, because I won’t get posts which are not liked by logged user. I want to have only information in each post if it is liked by user or not.</p>
<p>I’ve got right data, but during this operation:</p>
<blockquote>
<p>Enum.map(page.entries, fn post → <br>
%{“favourite” =&gt; Repo.all(Post.getFavourites(post.id, current_user.id))}<br>
end)</p>
</blockquote>
<p>It removes all my post data.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45011" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-45011" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45011"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="45012" data-post-id="45012">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Since you still didn’t show what you expect, I have to guess (again)…</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Enum.map(page.entries, fn post -&gt;
  post |&gt; Map.put("favourite", repo.all... 
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45012" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-45012" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45012"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="45013" data-post-id="45013">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maliawelli" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maliawelli
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/nobbz" rel="nofollow">@NobbZ</a><br>
Ok.<br>
I’m posting json, because it is much easier to get info than from terminal output.</p>
<p>I’ve got posts data like this:</p>
<blockquote>
<p>“posts”: [ { “votes”: [ { “post_id”: 4, “id”: 22, “author”: “equse” } ], “user_id”: 1, “user”: { “username”: “equse”, “id”: 1 }, “url”: “<a href="http://google.pl" rel="noopener nofollow ugc">http://google.pl</a>”, “title”: “Google”, “inserted_at”: “2017-07-21T22:08:11”, “id”: 4, “comments”: [ { “updated_at”: “2017-08-05T10:56:28”, “post_id”: 4, “inserted_at”: “2017-08-05T10:51:33”, “id”: 1, “body”: “test23333”, “author”: “equse” } ] } ]</p>
</blockquote>
<p>The same data in terminal output:</p>
<blockquote>
<p>[%Microscope.Post{<strong>meta</strong>: <span class="hashtag-raw">#Ecto.Schema.Metadata</span>&lt;:loaded, “posts”&gt;,<br>
comments: [%Microscope.Comment{<strong>meta</strong>: <span class="hashtag-raw">#Ecto.Schema.Metadata</span>&lt;:loaded, “comments”&gt;,<br>
author: “equse”, body: “test23333”, id: 1,<br>
inserted_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-08-05 10:51:33&gt;,<br>
post: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
post_id: 4, updated_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-08-05 10:56:28&gt;}], id: 4,<br>
inserted_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-07-21 22:08:11&gt;,<br>
notifications: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
posts_favourites: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
title: “Google”, updated_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-07-21 22:08:11&gt;,<br>
url: “<a href="http://google.pl" rel="noopener nofollow ugc">http://google.pl</a>”,<br>
user: %Microscope.User{<strong>meta</strong>: <span class="hashtag-raw">#Ecto.Schema.Metadata</span>&lt;:loaded, “users”&gt;,<br>
encrypted_password: “$2b$12$oWoyU3mUiVbnfqBwPPUycun3V9oHnn3kSCBoMWcW1mjcUS5C3Difa”,<br>
id: 1, inserted_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-07-17 19:57:44&gt;,<br>
notifications: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
password: nil,<br>
posts: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
shares: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
updated_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-07-17 19:57:44&gt;, username: “equse”},<br>
user_id: 1,<br>
votes: [%Microscope.Vote{<strong>meta</strong>: <span class="hashtag-raw">#Ecto.Schema.Metadata</span>&lt;:loaded, “votes”&gt;,<br>
author: “equse”, id: 22, inserted_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-08-06 12:22:14&gt;,<br>
post: <span class="hashtag-raw">#Ecto.Association.NotLoaded</span>,<br>
post_id: 4, updated_at: <span class="hashtag-raw">#Ecto.DateTime</span>&lt;2017-08-06 12:22:14&gt;}]}</p>
</blockquote>
<p>And it should look like:</p>
<blockquote>
<p>“posts”: [ { “favourite”: [ { “user_id”: 1, “post_id”: 2 } ] , “votes”: [ { “post_id”: 4, “id”: 22, “author”: “equse” } ], “user_id”: 1, “user”: { “username”: “equse”, “id”: 1 }, “url”: “<a href="http://google.pl" rel="noopener nofollow ugc">http://google.pl</a>”, “title”: “Google”, “inserted_at”: “2017-07-21T22:08:11”, “id”: 4, “comments”: [ { “updated_at”: “2017-08-05T10:56:28”, “post_id”: 4, “inserted_at”: “2017-08-05T10:51:33”, “id”: 1, “body”: “test23333”, “author”: “equse” } ] } ]</p>
</blockquote> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45013" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-45013" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45013"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="45016" data-post-id="45016">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="maliawelli" data-post="14" data-topic="7574">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/aeb1de/48.png" class="avatar"> maliawelli:</div>
<blockquote>
<p>I’ve got posts data like this:</p>
</blockquote>
</aside>
<p>Which I do not know how it gets deserialized into elixir terms, therefore mostly useless, also it is invalid JSON, since it is neither a list nor a single object.</p>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">%Microscope.Post{[…]}
</code></pre>
</blockquote>
<p>Oh… It is a struct. You can’t simply add or remove fields.</p>
<aside class="quote no-group" data-username="maliawelli" data-post="14" data-topic="7574">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/aeb1de/48.png" class="avatar"> maliawelli:</div>
<blockquote>
<p>And it should look like:</p>
</blockquote>
</aside>
<p>Is this JSON or elixir? doesn’t matter, its invalid in both cases.</p>
<hr>
<p>This may sound hard, but it seems as if fundamentals of elixir are missing, you should pick up a book and learn about them before continuing.</p>
<p>Also an important advice! Try to leave behind everything you learned in PHP! OOP vs FP (and related) aren’t the only differences, but if I start now it will end with rage-bashing PHP <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45016" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-45016" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45016"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="45017" data-post-id="45017">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maliawelli" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maliawelli
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/nobbz" rel="nofollow">@NobbZ</a></p>
<p>I’m just trying to implement “add to favourites” function. It can’t be so hard as it seems to be <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>Now my output looks like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">%{:__meta__ =&gt; #Ecto.Schema.Metadata&lt;:loaded, "posts"&gt;,
  :__struct__ =&gt; Microscope.Post, :comments =&gt; [], :id =&gt; 2,
  :inserted_at =&gt; #Ecto.DateTime&lt;2017-07-18 19:26:48&gt;,
  :notifications =&gt; #Ecto.Association.NotLoaded&lt;association :notifications is not loaded&gt;,
  :posts_favourites =&gt; #Ecto.Association.NotLoaded&lt;association :posts_favourites is not loaded&gt;,
  :title =&gt; "Wykop", :updated_at =&gt; #Ecto.DateTime&lt;2017-07-18 19:26:48&gt;,
  :url =&gt; "http://wykop.pl",
  :user =&gt; %Microscope.User{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "users"&gt;,
   encrypted_password: "$2b$12$oWoyU3mUiVbnfqBwPPUycun3V9oHnn3kSCBoMWcW1mjcUS5C3Difa",
   id: 1, inserted_at: #Ecto.DateTime&lt;2017-07-17 19:57:44&gt;,
   notifications: #Ecto.Association.NotLoaded&lt;association :notifications is not loaded&gt;,
   password: nil,
   posts: #Ecto.Association.NotLoaded&lt;association :posts is not loaded&gt;,
   shares: #Ecto.Association.NotLoaded&lt;association :shares is not loaded&gt;,
   updated_at: #Ecto.DateTime&lt;2017-07-17 19:57:44&gt;, username: "equse"},
  :user_id =&gt; 1,
  :votes =&gt; [%Microscope.Vote{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "votes"&gt;,
    author: "equsek", id: 10, inserted_at: #Ecto.DateTime&lt;2017-07-23 20:32:52&gt;,
    post: #Ecto.Association.NotLoaded&lt;association :post is not loaded&gt;,
    post_id: 2, updated_at: #Ecto.DateTime&lt;2017-07-23 20:32:52&gt;},
   %Microscope.Vote{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "votes"&gt;,
    author: "equse", id: 23, inserted_at: #Ecto.DateTime&lt;2017-08-06 19:47:24&gt;,
    post: #Ecto.Association.NotLoaded&lt;association :post is not loaded&gt;,
    post_id: 2, updated_at: #Ecto.DateTime&lt;2017-08-06 19:47:24&gt;}],
  "favourite" =&gt; [%{post_id: 2, user_id: 1}]}]
</code></pre>
<p>So my information about favourite is outside the brackets and my API doesn’t see that data.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45017" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-45017" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45017"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="45018" data-post-id="45018">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maliawelli" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maliawelli
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/nobbz" rel="nofollow">@NobbZ</a></p>
<p>I’m still learning elixir and sitting with book between my knees. But this operations should be as easy as in other languages <img src="https://forum.elixirforum.com/images/emoji/apple/frowning.png?v=15" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"></p>
<p>Also I’m trying to learn during some project.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45018" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-45018" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45018"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="45021" data-post-id="45021">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="maliawelli" data-post="16" data-topic="7574">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/aeb1de/48.png" class="avatar"> maliawelli:</div>
<blockquote>
<p>So my information about favourite is outside the brackets and my API doesn’t see that data.</p>
</blockquote>
</aside>
<p>Of what brackets?</p>
<p>Where do you want that information to be placed? The task itself is very simple, but only if one knows EXACTLY what you want to have!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45021" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-45021" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45021"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="45023" data-post-id="45023">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maliawelli" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maliawelli
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/nobbz" rel="nofollow">@NobbZ</a></p>
<p>As I wrote exactly few times. I would like to have information (if post is in favourites or not) inside each single post from posts array.</p>
<p>The best option would be to do this with ecto schema, but I haven’t found any example in documentation, so I’m trying just to fetch this in additional query.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45023" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-45023" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45023"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="45024" data-post-id="45024">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In the data you have shown us, you have shown a mangled struct, which <strong>was</strong> a <code>Post</code>, before you required to insert a String key.</p>
<p>And since <code>Post</code> is/should be a struct, you are normaly not allowed to simply add new keys to it. Structs are fixed. This is what I meant by saying you are missing fundamentals.</p>
<p>If you want to have a key in there, that is <code>:favourites</code> you need to add it to your <code>defstruct</code> or <code>schema</code>-definition (maybe virtual).</p>
<p>Also I still do not know what you mean by “outsoutside the brackets”. It would help both of us if you were using proper terms.</p>
<p>PS: Proper terms means as well to not talk about arrays, but lists, but I will excuse this for now.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45024" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-45024" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45024"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="45032" data-post-id="45032">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="gregvaughn" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gregvaughn/120/954_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  gregvaughn
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="maliawelli" data-post="12" data-topic="7574">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/aeb1de/48.png" class="avatar"> maliawelli:</div>
<blockquote>
<p>I can’t use join, because I won’t get posts which are not liked by logged user. I want to have only information in each post if it is liked by user or not.</p>
</blockquote>
</aside>
<p>I’m really confused at what you want. You want a true/false indicator in a list of posts you already have? Then either be really inefficient and keep what you have and just set to true if the count of results from <code>get_favourites</code> is 1, else false. Or else run a 2nd query to find all the user’s favourites and set a key on each matching post via an <code>Enum.map</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="45032" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/has-many-through-many-fields/7574/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-45032" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="45032"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/7574/load_more?page=3">Load more posts (9 remaining)</a>
</div></template></turbo-stream>