# WIX Stores (wix code) collections question

**URL:** <https://forum.wixstudio.com/t/wix-stores-wix-code-collections-question/10515>\
**Category:** Ask the community\
**Tags:** wix-stores, code, question\
**Created:** [July 4, 2018, 1:39pm UTC](https://forum.wixstudio.com/t/wix-stores-wix-code-collections-question/10515 "2018-07-04T13:39:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olya-black](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/olya-black/32/739_2.png) [@olya-black](https://forum.wixstudio.com/u/olya-black)\
**Post date:** [July 4, 2018, 1:39pm UTC](https://forum.wixstudio.com/t/wix-stores-wix-code-collections-question/10515/1 "2018-07-04T13:39:20Z")

</div>

We are doing an ecom ising wix code now  
Just wanted to ask something  
The Stores Database does not provide the information on what product is on what collection.  
Shouldn’t there be a column with the category that that product has? Or do we miss something?  
Thank you

---

<div class="post-metadata">

**Author:** ![andreas-kviby](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/andreas-kviby/32/790_2.png) [@andreas-kviby](https://forum.wixstudio.com/u/andreas-kviby)\
**Post date:** [July 4, 2018, 2:27pm UTC](https://forum.wixstudio.com/t/wix-stores-wix-code-collections-question/10515/2 "2018-07-04T14:27:16Z")

</div>

The collections is connected to the products through the reference between them, otherwise if you can’t make that work I should do my own Category Data Collection and add the products into that you need. I am making an e-commerce solution completely in Wix Code without anything from Wix Stores but it is a huge project but fun one 🙂

---

<div class="post-metadata">

**Author:** ![chris-derrell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/chris-derrell/32/1774_2.png) [@chris-derrell](https://forum.wixstudio.com/u/chris-derrell)\
**Post date:** [July 4, 2018, 3:10pm UTC](https://forum.wixstudio.com/t/wix-stores-wix-code-collections-question/10515/3 "2018-07-04T15:10:09Z")

</div>

Hey Olya,

There is a link between them, but there is no visible column which identifies it when you look into the database.

**You can filter products by collection like this:**

```javascript
$w("#yourProductsDataset").setFilter( wixData.filter().hasSome("collections.id", [list,of,category,ids,you,look,for]) );

```

You can get the filtered products returned by the function like so.

```javascript
import wixData from 'wix-data';

wixData.query("Stores/Products").hasSome("collections.id", [list,of,category,ids,you,look,for]) ).find().then( (results)=>{
     let items = results.items;
} );
 

```

If “Stores/Products” doesn’t work, check the name of your Wix Stores collection.

---

<div class="post-metadata">

**Author:** ![giri-zano](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/giri-zano/32/80469_2.png) [@giri-zano](https://forum.wixstudio.com/u/giri-zano)\
**Post date:** [July 4, 2018, 5:57pm UTC](https://forum.wixstudio.com/t/wix-stores-wix-code-collections-question/10515/4 "2018-07-04T17:57:59Z")

</div>

But what if you have a Product page before your nose, and you want to retrieve it´s collection.id?
