> For the complete documentation index, see [llms.txt](https://mongoose.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mongoose.shujuwajue.com/guide/documents/subdocs_md.md).

# 子文档（sub docs）

> 原文：[Sub Docs](http://mongoosejs.com/docs/subdocs.html)\
> 翻译：小虾米（QQ:509129）\
> 进度：未完成

## sub docs

Sub-documents are docs with schemas of their own which are elements of a parents document array:

```javascript
var childSchema = new Schema({ name: 'string' });

var parentSchema = new Schema({
  children: [childSchema]
})
```
