0

I need this document structure:

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',
      ]
    }
  ],
]
});

I tried using the following SimpleSchema to describe it:

audio_files: {
  type: [[String]]
}

This is wrong config.

How can I properly make this schema?

Kyll
  • 7,036
  • 7
  • 41
  • 64
Nazariy
  • 408
  • 3
  • 10
  • Welcome to SO! Your question had several issues: The title did not describe your issue, you used code snippets while this is Meteor code, not native/jQuery code (thus useless to execute on SO), you begged ("help me please") when it is not necessary since we are here to help, and you do not describe what the issue actually is ("wrong config" is very vague, describe precisely the issue, for example with "This does not produce the object I want"). I fixed some of these issues for you. Please make sure to check the [help]. – Kyll Sep 01 '15 at 10:10

1 Answers1

0
audiofiles: {
    type: [Object]
},
'audio_files.$.paths': {
    type: String
},
'audio_files.$.transcriptions': {
    type: [String]
}

Look here for more.

PhilippSpo
  • 789
  • 7
  • 10