我有这个问题 我很累 我无法解决这个问题Cast to string failed for value \"{}\" at path \"post\
{
"confirmation": "fail",
"message": {
"message": "Cast to string failed for value \"{}\" at path \"post\"",
"name": "CastError",
"stringValue": "\"{}\"",
"kind": "string",
"value": {
},
"path": "post"
}
}
Run Code Online (Sandbox Code Playgroud)
希望你能帮助我
索引.html
<h1>CreateComment</h1>
<form action="/api/comment" method="post">
<input type="text" name="post" placeholder="Post" /><br />
<input type="text" name="text" placeholder="Text"><br />
<input type="submit" value"Create" />
</form>
Run Code Online (Sandbox Code Playgroud)
评论.js
var mongoose = require('mongoose')
var CommentSchema = new mongoose.Schema({
profile: {type: mongoose.Schema.Types.Mixed, default: {}},
post: …Run Code Online (Sandbox Code Playgroud)