enum '/[a-Z]+Id/': { $type: '?number', isPattern: true }, // pattern fields address: 'string', secondAddress: '?string', // optional fields options: { notifications: 'boolean', lvls: ['number', 'string'] }, }); const systemSchema = new Schema({ $type: 'array', items: ...