如何使用aldeed:simple-schema 来描述这个错综复杂的文档结构?
How to describe this intricated document structure using aldeed:simple-schema?
我需要这个文档结构:
lessons.insert({
name: 'some_name',
audio_files: [
[
{
paths: 'paths/to/file1',
transcriptions: [
'Transcript ..........1',
'Transcript ..........2',
'Transcript ..........3',
]
}
],
[
{
paths: 'paths/to/file2',
transcriptions: [
'Transcript ..........1',
'Transcript ..........2',
'Transcript ..........3',
]
}
],
]
});
我试着用下面的SimpleSchema来描述它:
audio_files: {
type: [[String]]
}
这是错误的配置。
如何正确制作此架构?
audiofiles: {
type: [Object]
},
'audio_files.$.paths': {
type: String
},
'audio_files.$.transcriptions': {
type: [String]
}
查看 here 了解更多。
我需要这个文档结构:
lessons.insert({
name: 'some_name',
audio_files: [
[
{
paths: 'paths/to/file1',
transcriptions: [
'Transcript ..........1',
'Transcript ..........2',
'Transcript ..........3',
]
}
],
[
{
paths: 'paths/to/file2',
transcriptions: [
'Transcript ..........1',
'Transcript ..........2',
'Transcript ..........3',
]
}
],
]
});
我试着用下面的SimpleSchema来描述它:
audio_files: {
type: [[String]]
}
这是错误的配置。
如何正确制作此架构?
audiofiles: {
type: [Object]
},
'audio_files.$.paths': {
type: String
},
'audio_files.$.transcriptions': {
type: [String]
}
查看 here 了解更多。