# Multiple Properties in single Vertex

**URL:** <https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164>\
**Category:** Cypher\
**Tags:** cypher, gremlin\
**Created:** [July 29, 2021, 11:54am UTC](https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164 "2021-07-29T11:54:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kidzofy](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kidzofy/32/19446_2.png) [@kidzofy](https://community.neo4j.com/u/kidzofy)\
**Post date:** [July 29, 2021, 11:54am UTC](https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164/1 "2021-07-29T11:54:49Z")

</div>

Could you please help me understand if we can have multiple array properties in 1 vertex.. For example,

```auto
"id": "CU10611973PH",
    "label": "Phone-Home",
    "type": "vertex",
    "properties": {
      "PhonePreference": [
        {
          "id": "c63cf5c9-329b-456e-b94e-0c500587780f",
          "value": "Primary"
        }
      ],
      "PhoneType": [
        {
          "id": "11f241d8-8e84-479b-b6a4-aeab7e039665",
          "value": "Home"
        }
      ],
      "PhoneNumber": [
        {
          "id": "5795e2ec-6d8c-424c-b42d-f01b587caeca",
          "value": "22222222222"
        }
      ],
      "pk": [
        {
          "id": "CU10611973PH|pk",
          "value": "pk"
        }
      ]
    }
  },
  {
    "id": "CU10611973PC",
    "label": "Phone-cell",
    "type": "vertex",
    "properties": {
      "PhonePreference": [
        {
          "id": "488c54b2-f256-4053-adc5-c07ec2e1a629",
          "value": "Primary"
        }
      ],
      "PhoneType": [
        {
          "id": "2f5263e7-f42b-487f-a185-338682a68fdd",
          "value": "Cell"
        }
      ],
      "PhoneNumber": [
        {
          "id": "a967516d-986c-4eac-929a-b86824677922",
          "value": "123456789"
        }
      ],
      "pk": [
        {
          "id": "CU10611973PC|pk",
          "value": "pk"

```

So here we are having 2 vertex, one for Phone-Home and one for Phone-Cell. Is there a way to make it come under 1 vertex with 2 set of properties, where both could be easily queried and outputs as 2 arrays in 1 vertex

```auto

```

---

<div class="post-metadata">

**Author:** ![Bennu](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bennu/32/11659_2.png) [@Bennu](https://community.neo4j.com/u/Bennu)\
**Post date:** [July 29, 2021, 12:07pm UTC](https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164/2 "2021-07-29T12:07:39Z")

</div>

Hi @kidzofy !

Why not just 2 vertexes with a _Phone_ Tag plus relation _HAS\_PHONE_?

Otherwise you may need some to storage the array as a JSON but it will not so easy to query info related to.

H

---

<div class="post-metadata">

**Author:** ![kidzofy](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kidzofy/32/19446_2.png) [@kidzofy](https://community.neo4j.com/u/kidzofy)\
**Post date:** [July 29, 2021, 1:11pm UTC](https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164/3 "2021-07-29T13:11:33Z")

</div>

@Bennu : Thanks for the info.. Actually we have around 6-7 phone number entries per person and 2-4 addresses along with 2-3 email addresses. So it will be really bulky for a single customer. I mean 10-12 vertices just for a single Customer personal details.. So in future this might go upto 100 vertices per Customer when other details come into picture. So were thinking to put all sub categories as 1 vertex.

Just to clarify a single customer might have 2 categories Primary and Alternative. And in each category he might be having "Home","Cell" and "Work" type of phone numbers.. So right now we are having 1 phone tag and has phone with all these sub categories.. But it is making the system more bulky. Could you please help put some insight on how to proceed.

---

<div class="post-metadata">

**Author:** ![Bennu](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/bennu/32/11659_2.png) [@Bennu](https://community.neo4j.com/u/Bennu)\
**Post date:** [July 30, 2021, 10:20am UTC](https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164/4 "2021-07-30T10:20:09Z")

</div>

Oh I get it.

You can try something like this.

```auto
CREATE(p:Person)-[:HAS_CONTACT_INFO]->(i:Info)
set p.NAME = 'Gary'
SET i:Phone
SET i.HOME_PRIMARY = ["2222222222", "+32238922932"]
SET i.HOME_ATERNATIVE = []
SET i.CELL_PRIMARY = ["33333333"]
SET i.CELL_ALTERNATIVE = ["23"]
return i

```

And then query persons like:

```auto
MATCH(d:Person)-[:HAS_CONTACT_INFO]->(i:Info)
where any(number in i.CELL_PRIMARY where number starts with "33")
return d 

```

I hope this example may give you more insights about.

EDIT: I'm wondering how does index work on array tho.

H

---

<div class="post-metadata">

**Author:** ![kidzofy](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kidzofy/32/19446_2.png) [@kidzofy](https://community.neo4j.com/u/kidzofy)\
**Post date:** [August 3, 2021, 2:18am UTC](https://community.neo4j.com/t/multiple-properties-in-single-vertex/42164/5 "2021-08-03T02:18:12Z")

</div>

thank you sooo much. Let me try that out
