mongoose-timezone
mongoose-timezone copied to clipboard
subDocument timezone problem
Hi, I have a problem my subDocument don't update to local timezone
{
"prices" : [
{
"price" : {
"USD" : NumberInt(10),
},
"description" : {
"en" : "test"
},
"createdAt" : ISODate("2020-05-11T05:39:34.435+0000"),
"updatedAt" : ISODate("2020-05-11T05:39:34.435+0000")
}
],
"createdAt" : ISODate("2020-05-11T10:09:34.435+0000"),
"updatedAt" : ISODate("2020-05-11T10:09:34.435+0000"),
"__v" : NumberInt(0)
}
as you can see my createdAt in root and in prices.0.createdAt are different! my schema is :
const SchemaPrice = Schema({
price: {
type: Object,
required: true,
},
}, {_id: false, timestamps: true});
const schemaObject = {
prices: [SchemaPrice]
};
const ModelSchema = new Schema(schemaObject,{timestamps: true});
what should i do?