2

I have the following property in object defined in Mongoose schema, is there a way to prevent Moongose from assigning default enum value on App.create() or during upserting

band_collection: {
    type: String,
    enum: COLLECTIONS.concat('Custom')
}

// collection

COLLECTIONS = ['red', 'white', 'blue']
eugenekgn
  • 1,652
  • 2
  • 17
  • 38

1 Answers1

0

Hmm nope that shouldn't be happening, that code looks correct as far as I can tell. Can you provide a more complete code sample?

vkarpov15
  • 3,614
  • 24
  • 21