I would like to define a Mongoose schema that accepts any property name in relation to Stringhow its value is. I am looking for something like the following (not having, first of all, write any possible property name):
var schema = new Schema({
name: String,
someStrings: {
string1: String,
string2: String,
...
stringN: String
}
});
I know that I can just use it Schema.Types.Mixed, but that would allow using arrays or other types internally. In addition, Mongoose will lose its ability to automatically detect and save changes to this property.
var schema = new Schema({
name: String,
someStrings: Schema.Types.Mixed
});
I just want to have an Object (someString) that consists of only an arbitrary amount of name for the value of the Stringmappings with any possible name.
Is it possible similar in mongoose?
Tuxer