# How to create the empty array

**URL:** https://forum.tiledb.com/t/how-to-create-the-empty-array/180
**Category:** Uncategorized
**Created:** [May 8, 2020, 11:03pm UTC](https://forum.tiledb.com/t/how-to-create-the-empty-array/180 "2020-05-08T23:03:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mikejiang](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/mikejiang/32/102_2.png) [@mikejiang](https://forum.tiledb.com/u/mikejiang)
#### Post date: [May 8, 2020, 11:03pm UTC](https://forum.tiledb.com/t/how-to-create-the-empty-array/180/1 "2020-05-08T23:03:49Z")

</div>

I have some edge cases where empty arrays need be represented in tiledb, e.g. matrix of (0 x ncols) or (nrows x 0).  
I am having trouble to model those since tiledb::dimension (for dense) doesn’t allow empty domains {1,0},  
but if I set domain as {1,1}, it can’t really model the empty array, right?

---

<div class="post-metadata">

### Author: ![stavros](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@stavros](https://forum.tiledb.com/u/stavros)
#### Post date: [May 8, 2020, 11:10pm UTC](https://forum.tiledb.com/t/how-to-create-the-empty-array/180/2 "2020-05-08T23:10:11Z")

</div>

Regardless of what domain you specify for the array, unless you write anything to the array, the array is “empty”. You can determine this by checking the “non-empty domain”: [https://docs.tiledb.com/main/api-usage/reading-arrays/basic-reading#getting-the-non-empty-domain](https://docs.tiledb.com/main/api-usage/reading-arrays/basic-reading#getting-the-non-empty-domain)

That returns a bounding hyper-rectangle for all the writes you have performed. If that is empty/null then you know that your array is actually empty.

I hope this helps.

---

<div class="post-metadata">

### Author: ![mikejiang](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/mikejiang/32/102_2.png) [@mikejiang](https://forum.tiledb.com/u/mikejiang)
#### Post date: [May 9, 2020, 3:40am UTC](https://forum.tiledb.com/t/how-to-create-the-empty-array/180/3 "2020-05-09T03:40:12Z")

</div>

Awesome! This resolves my problems. Hope you can help with vector issue (see its separate post) when you get a chance.
