Wednesday, 5 April 2017

MongoDB model have an object with multiple values in schema (using mongoose)

I want to have a field that is an object, which has 4 values, like this:

... new mongoose.Schema({
   phones: {
     cellphone1: Number,
     cellphone2: Number,
     phone: Number,
     radio: Number
   }
});

is this valid code? thanks in advance!



via nick

No comments:

Post a Comment