Replies: 1 comment
-
Can you paste the stack trace and the complete error message? Cast error messages should show the value that failed to cast and the expected type. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am facing an issue "Cast to Array failed for value" for the mongoose subdocument. And didn't find anything about it. Can anybody help me with it?
Here is my Schema:
const Screens = new Schema({
title: {
type: String,
default: null
},
message: {
type: String,
default: null
}
});
const ProjectSurveys = new Schema({
project_id: {
type: ObjectId,
ref: "account_projects"
},
name: {
type: String,
default: ""
},
description: {
type: String,
default: ""
},
trigger_event_name: {
type: String,
required: true
},
data: [Screens],
created_on: {
type: Number,
default: () => new Date().valueOf()
},
updated_on: {
type: Number,
},
schema: {
type: Number,
// eslint-disable-next-line no-undef
default: __schema_version
}
});
Beta Was this translation helpful? Give feedback.
All reactions