Hi, I’m having difficulties to store data in document when it is a object which contains arrays. In Client side, I’m doing a JSON.Stringify before sending the data, but in back-end it does add only string whereas I need Object with string and arrays.
Please find my model
/* ======= Model ======= */
const ElectronicSignatureSchema = new mongoose.Schema({
activate: Boolean,
delete: Boolean,
facility: {
type: mongoose.Schema.Types.ObjectId,
ref: "facility",
},
title: String,
signature_NC_reception: {
type: String, // family | user
module: String, // material | analysis | articles | nonConformity...
families: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "family",
},
],
users: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "user",
},
],
},
I will have no solution to declare the item as follow signature_NC_reception: Object
, to have the chance to get my data. Really pity.
Many thanks if someone has the magic trick.