         meta: { type: 'object' }
         $loki: { type: 'integer' }
       }
-      required: [ 'type', 'id', 'path', 'status', 'translatorID', 'exportNotes', 'useJournalAbbreviation' ],
+      required: [ 'path', 'status', 'translatorID', 'exportNotes', 'useJournalAbbreviation' ],
+
+      oneOf: [
+        { required: ['library'], properties: { library: { type: 'integer' } } },
+        { required: ['collection'], properties: { collection: { type: 'integer' } } },
+        { required: ['collection'], properties: { collection: { type: 'string', minLength: 1 } } },
+      ],
+
       additionalProperties: false
     }
   })

      properties: {
        itemID: { type: 'integer' }
        libraryID: { type: 'integer' }
        citekey: { type: 'string' }
        pinned: { type: 'boolean', default: false }

        # LokiJS

  debug('after DB schemaCollection:', { keys: DB.getCollection('citekey') })

  DB.schemaCollection('autoexport', {
    indices: [ 'collection', 'library', 'status', 'path', 'exportNotes', 'translatorID', 'useJournalAbbreviation'],
    unique: [ 'path' ],
    logging: true,
    schema: {
      type: 'object'
      properties: {
        type: { enum: [ 'collection', 'library' ] }
        id: { type: 'integer' }
        path: { type: 'string', minLength: 1 }
        status: { enum: [ 'scheduled', 'running', 'done', 'error' ] }
        translatorID: { type: 'string', minLength: 1 }
        exportNotes: { type: 'boolean', default: false }
        useJournalAbbreviation: { type: 'boolean', default: false }

