I've searched around and other solutions don't seem to be working I must be missing something obvious
Here's what i'm doing
{% set myVar = '' %}
{% for block in entry.matrixComponent %}
{% if block.type == "matixBlockType" %}
{% set myVar = block.matrixBlockField.ids() %}
{% endif %}
{% endfor %}
This seems to work when I dump myVar I get
array(1) {
[0]=>
string(5) "10032"
which is indeed the id I'm looking for. I then
{% if entry.id not in myVar %}
<div> {{ entry.id }} {{ Title }} not in myVar </div>
{% else %}
<div> {{ entry.id }} {{ Title }} is in myVar {{ myVar }} </div>
{% endif %}
It lists out my posts in the matrix component, and where the entry.id matches myVar it still says not in myVar even though it would seem to me that it should have excluded it.
I'm not sure why it is listing the entry that matches myVar's Id