These are chat archives for Automattic/mongoose

Mar 2018
Mar 30 2018 01:49

Hi, I am new to Mongoose and trying to design the Schema having nested schema, but with the keys not specified.

  stats: {
    date: [ { timestamp: String, task: String } ]

In the above code, I want to make the key date as a string of date.

I am wondering if there is any solution to implement this except the type of Schema.Types.Mixed, or any other design logic to do the same thing?

Mar 30 2018 08:43
@hieverest take a look at Automattic/mongoose#681. ES6 Maps support is being worked on for a future release of mongoose ( currently set for 5.1 milestone ).