0

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.

Tyler2P
  • 2,324
  • 26
  • 22
  • 31

0 Answers0