I have 5 fields in my document. I want to turn this,
autoRole1: {
type: String
},
autoRole2: {
type: String
},
autoRole3: {
type: String
},
autoRole4: {
type: String
},
autoRole5: {
type: String
}
To this(for example):
autoRole1: {
type: String
},
autoRole3: {
type: String
},
autoRole4: {
type: String
},
autoRole5: {
type: String
}
How can I do it? This is the code I've tried:
const Welcome = require('../../models/Guild');
Welcome.update({guildId: message.guild.id}, { $unset: { "autoRole1": 1 } }, { multi: false });