# wixData.query - .ne() Return Value Issues 

**URL:** <https://forum.wixstudio.com/t/wixdata-query-ne-return-value-issues/41704>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [May 21, 2018, 5:51pm UTC](https://forum.wixstudio.com/t/wixdata-query-ne-return-value-issues/41704 "2018-05-21T17:51:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![galaxygalaxy](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@galaxygalaxy](https://forum.wixstudio.com/u/galaxygalaxy)\
**Post date:** [May 21, 2018, 5:51pm UTC](https://forum.wixstudio.com/t/wixdata-query-ne-return-value-issues/41704/1 "2018-05-21T17:51:59Z")

</div>

I am trying to run a query, which only gives back items that have a field value which is not included in an array. The query that I get back, always includes items with values that are in my array and should therefore be excluded.

If I understand the documentation correctly, this should be possible:  
If the value of the propertyName property is an Array, ne() includes items in which none of the elements of the Array match the specified value.

My code:

```javascript
function display_next_user() {
     wixData.query("Users")
        .ne('row_num', user_clicked) //user_clicked is the array
        .find()
        .then( (results) => {
            let items = results.items[0]
            let firstname1 = items.vorname;
            let lastname1 = items.nachname;
            let user_rownum = items.row_num;
            $w("#text3").text = firstname1;
            $w("#text4").text = lastname1;
            user_clicked.push(user_rownum);
        } );
}

```

The query that I get with this code includes the first item, although it should be excluded.

```javascript
 {"items":[{"_id":"46c869f8-b80a-464c-83be-5a34c75d9cae","vorname":"Max","punkte":5,"row_num":0,"_createdDate":"2018-05-21T13:24:36.125Z","_updatedDate":"2018-05-21T17:33:40.249Z","_owner":null,"schule":"School","jahrgang":"11","nachname":"M."} 

```

In the Developer Console, I get the following line at the end of the query result.

```javascript
"length":13,"totalCount":13,"query":{"invalidArguments":[],"filterTree":{"$and":[{"row_num":{"$ne":[0]}}]},"provider":{},"collectionName":"Users","limitNumber":50,"included":[]}} 

```

What am I doing wrong?

Thanks

---

<div class="post-metadata">

**Author:** ![simonas-pauliukevici](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/simonas-pauliukevici/32/669_2.png) [@simonas-pauliukevici](https://forum.wixstudio.com/u/simonas-pauliukevici)\
**Post date:** [May 28, 2018, 12:24pm UTC](https://forum.wixstudio.com/t/wixdata-query-ne-return-value-issues/41704/2 "2018-05-28T12:24:25Z")

</div>

Hi there,  
The docs say that the actual value in the collection may be an array, not the parameter you pass to ne(). The difference:

- your expected behavior: only items where the value of the field matches none of the items of the supplied array are returned
- actual behavior: only items where the value of the field (which is an array) does not contain the supplied value are returned

Try this instead:

```javascript
query.not(wixData.query(collectionId).hasSome('row_num', exclusions))

```

---

<div class="post-metadata">

**Author:** ![galaxygalaxy](https://avatars.discourse-cdn.com/v4/letter/g/65b543/32.png) [@galaxygalaxy](https://forum.wixstudio.com/u/galaxygalaxy)\
**Post date:** [May 30, 2018, 5:32pm UTC](https://forum.wixstudio.com/t/wixdata-query-ne-return-value-issues/41704/3 "2018-05-30T17:32:52Z")

</div>

Hi, thanks a lot!!
