In a personal project of mine I use Mongoose.js to store information in a MongoDB Database.
I have a schema like:
const downloadSchema = new mongoose.Schema({
title: {
type: String,
unique: false,
required: true,
trim: false
},
author: {
type: String,
unique: false,
required: true,
trim: true
}
})
I would like to add a file “versions” to the schema, it should be an array with an object like:
{
version: Number,
link: String
}
How would I implement this into the schema?