# Is it possible to nest document types?

**URL:** <https://community.swiftype.com/t/is-it-possible-to-nest-document-types/180>\
**Category:** Setup & Indexing\
**Created:** [April 11, 2016, 5:47pm UTC](https://community.swiftype.com/t/is-it-possible-to-nest-document-types/180 "2016-04-11T17:47:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/swiftype/original/1X/fd652d1735c60057fa71c371375511028f9a1832.png) [@system](https://community.swiftype.com/u/system)\
**Post date:** [April 11, 2016, 5:47pm UTC](https://community.swiftype.com/t/is-it-possible-to-nest-document-types/180/1 "2016-04-11T17:47:22Z")

</div>

> **I want to be able to have a parent and child relationship of my documents? Can I use a nested document type, or is there another solution to this problem?**

Currently, Swiftype’s document store does not nest documents. What we would recommend is for you to create two separate document types that have unique keys, with the children referencing the parent document.

For example, say you have document types of “posts” and each post has a number of “comments”. We recommend two document types of `posts` and `comments`. Each `comments` document can then be created to include a field of `post_id` to reference the original `posts` document it relates to.
