Answers for "nested json schema mongoose"

2

nested json schema mongoose

var mongoose =require('mongoose');
var Schema = mongoose.Schema;

var msg = new Schema({
  messageType: String,
  timestamp: Number,
  messagestatus: String
});

var standardmessage = new Schema({
  id: Number,
  name: String,
  type: String,
  message: [msg]
});
Posted by: Guest on April-01-2020
1

nested json schema mongoose

var mongoose =require('mongoose');
var Schema = mongoose.Schema;

var standardmessage = new Schema({
  id: Number,
  name: String,
  type: String,
  message: {
    messageType: String,
    timestamp: Number,
    messagestatus: String
  }
});
Posted by: Guest on April-01-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language