How to store object in a document which contains arrays?

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 :slight_smile:

/* ======= 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.

well what you can do is, its one of doing it, but i dont know if its the most efficient. Instead of using stringfy, Do something like the following, its just an example

ElectronicSignatureSchema object = new ElectronicSignatureSchema({
activate: //some value,
facility: //some value etc
});

await object.save()