In a schema for a collection I have in Mongoose, I have a string value required like so for a particular model:
preExecutionText: { type: String, required: true }
However, if I try to store an empty string for this property, I get this error:
'nodeData.29.preExecutionText': ValidatorError: Path 'preExecutionText' is required.
I figure that setting required to true for this property means that I can't store empty strings. Is there a way to configure this so that only null values aren't allowed, and empty strings are?