小编MEA*_*bid的帖子

值转换为字符串失败

我有这个问题 我很累 我无法解决这个问题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)

javascript mongoose node.js express bluebird

1
推荐指数
1
解决办法
8856
查看次数

标签 统计

bluebird ×1

express ×1

javascript ×1

mongoose ×1

node.js ×1