You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Mongoose version
7.4.1
Node.js version
18
MongoDB server version
4.4
Typescript version (if applicable)
No response
Description
Seems Map schema type makes unnecessary conversion via __schemaType.applyGetters for updates query. I noted it when developing my custom types that based on MongooseBuffer, i just tried Map + UUID combination and got the same issue.
Steps to Reproduce
importmongoosefrom'mongoose';import{randomUUID}from'node:crypto';constSchema=newmongoose.Schema({doc_map: {type: mongoose.Schema.Types.Map,of: mongoose.Schema.Types.UUID,},},{collection: 'users_test'},);constUser=mongoose.model('TestUser',Schema);asyncfunctiontest(){constuser=newUser({doc_map: newMap([['role_1',randomUUID()],['role_2',randomUUID()],]),});awaituser.save();// all good hereconsole.log(user.doc_map);// trying to updateuser.doc_map.set('role_1',randomUUID());awaituser.save();// got string in doc_map -> role_1}test().catch(console.error);
Expected Behavior
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Mongoose version
7.4.1
Node.js version
18
MongoDB server version
4.4
Typescript version (if applicable)
No response
Description
Seems Map schema type makes unnecessary conversion via
__schemaType.applyGetters
for updates query. I noted it when developing my custom types that based on MongooseBuffer, i just tried Map + UUID combination and got the same issue.Steps to Reproduce
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: