如何将数据添加到邮递员
How to add data into postman
如果我想在下面的架构中添加一些数据:
'use strict';
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var notificationsSchema = new mongoose.Schema({
notifyMessage : {
title : { type: String },
des : { type: String }
},
notifier : { type: String },
recipient : [{
id : { type: String },
status : {type:String,trim:true,enum:['read','unread']}
}]
});
module.exports = mongoose.model('notification_tracker', notificationsSchema);
我这样试过:
结果却变成了这样..
我认为您可以选择 "raw" 选项而不是 form-urlencoded,然后只需输入 json 代码:
notifyMessage : {
title : something,
des : something
}}
...etc
Select raw 单选按钮并确保将其设置为 JSON(application/json) 然后像这样粘贴或添加 JSON 对象
{
notifyMessage: {
title: "",
des: ""
},
notifier: "",
recipient: [{
id: "",
status:""
}, {
id: "",
status:""
}]
}
使用这种格式
如果我想在下面的架构中添加一些数据:
'use strict';
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
var notificationsSchema = new mongoose.Schema({
notifyMessage : {
title : { type: String },
des : { type: String }
},
notifier : { type: String },
recipient : [{
id : { type: String },
status : {type:String,trim:true,enum:['read','unread']}
}]
});
module.exports = mongoose.model('notification_tracker', notificationsSchema);
我这样试过:
结果却变成了这样..
我认为您可以选择 "raw" 选项而不是 form-urlencoded,然后只需输入 json 代码:
notifyMessage : {
title : something,
des : something
}}
...etc
Select raw 单选按钮并确保将其设置为 JSON(application/json) 然后像这样粘贴或添加 JSON 对象
{
notifyMessage: {
title: "",
des: ""
},
notifier: "",
recipient: [{
id: "",
status:""
}, {
id: "",
status:""
}]
}
使用这种格式