I have a mongoose schema that looks like this:
const mongoose = require('mongoose');
const reactionSchema = mongoose.Schema({
guildId: String,
reactionRoles: Array
});
module.exports = mongoose.model('reaction', reactionSchema);
I want to be able to add objects into the reactionRoles
array. How do I do that?
I could just do it with data.push
and findOneAndUpdate
but I want it to be faster.