I'm newbie to mongodb
Here is my schema
import mongoose, { Schema } from 'mongoose';
const SomeSchema = new Schema({
vDocs: [{type: String , required: true, }],
vBelongsTo: { type: Schema.Types.ObjectId, ref: 'User' }
});
const SomeSchema = mongoose.model('BlaBla', SomeSchema);
export default SomeSchema;
mongoose is saving only simple array like ["bla", "bla"]
in
vDocs
but I want to save something like this [{key: val}, {key: val}]
in
vDocs
Both are array I don't why is not working