Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add data into postman

If I want to add some data to my schema below:

'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);

I tried this way: enter image description here enter image description here

But it ended up this way..

like image 347
swati kiran Avatar asked Oct 30 '22 13:10

swati kiran


1 Answers

Select the raw radio button and make sure to set it as JSON(application/json) then paste or add your JSON object like this

enter image description here

{
  notifyMessage: {
    title: "",
    des: ""
  },
  notifier: "",
  recipient: [{
    id: "",
    status:""
  }, {
    id: "",
    status:""
  }]
}

Using this format

like image 54
prtdomingo Avatar answered Nov 10 '22 00:11

prtdomingo