Open blasdfaa opened 2 years ago
const userSchema = mongoose.Schema({ movies_ids: Array }) When specifying the field as "Array", I get this error:
const userSchema = mongoose.Schema({ movies_ids: Array })
const arraySchema = Array.isArray(value) ? value[0] : value.type[0]; ^ TypeError: Cannot read properties of undefined (reading '0')
But if you specify so, then everything works const userSchema = mongoose.Schema({ movies_ids: [] })
const userSchema = mongoose.Schema({ movies_ids: [] })
const userSchema = mongoose.Schema({ movies_ids: Array })
When specifying the field as "Array", I get this error:But if you specify so, then everything works
const userSchema = mongoose.Schema({ movies_ids: [] })