remove _id when converting to json

This commit is contained in:
Ordis 2024-06-22 23:14:52 +02:00
parent d793ff44fd
commit b691bba6c7

View File

@ -525,7 +525,13 @@ weaponSkinsSchema.virtual("ItemId").get(function () {
return { $oid: this._id.toString() }; return { $oid: this._id.toString() };
}); });
weaponSkinsSchema.set("toJSON", { virtuals: true }); weaponSkinsSchema.set("toJSON", {
virtuals: true,
transform(_doc, ret, _options) {
delete ret._id;
delete ret.__v;
}
});
const tauntHistorySchema = new Schema<ITauntHistory>( const tauntHistorySchema = new Schema<ITauntHistory>(
{ {