To save array of strings with Node Mongoose, we put the data type in an array.
For instance, we write
const personSchema = new mongoose.Schema({
tags: [
{
type: String,
},
],
});
to add the tags
field to the personSchema
and make it a string array field with
[
{
type: String,
},
];