Is there any way I can insert a property into this validator for inserting documents into MongoDB that will not impact validation but that I can retrieve via query?
To give some context: I use the validator to create a form dynamically, and I need some extra information to create the form according to my needs.
{
$jsonSchema: {
bsonType: 'object',
required: [
'active',
'productive',
'translation',
'code'
],
properties: {
code: {
bsonType: 'string',
minLength: 0,
maxLength: 50,
},
active: {
bsonType: 'bool'
},
productive: {
bsonType: 'bool'
},
translation: {
bsonType: 'object',
properties: {
'pt-BR': {
bsonType: 'object',
required: [
'description'
],
properties: {
description: {
bsonType: 'string',
minLength: 0,
maxLength: 50
}
}
},
'en-US': {
bsonType: 'object',
required: [
'description'
],
properties: {
description: {
bsonType: 'string',
minLength: 0,
maxLength: 50
}
}
}
}
},
audit: {
bsonType: 'object',
required: [
'user'
],
properties: {
user: {
bsonType: 'string'
}
}
}
}
}
}