zeromicro / go-zero

A cloud-native Go microservices framework with cli tool for productivity.
https://go-zero.dev
MIT License
29.37k stars 3.97k forks source link

Fix mongo's bson decoder timezone #4373

Open Awadabang opened 2 months ago

Awadabang commented 2 months ago

Is your feature request related to a problem? Please describe. When I upgrade gozero's version, all my time.Time data query from mongodb changes to UTC. I found the reason that mongo-driver's version has upgraded, the bson decoder decodes time.Time as UTC by default.

Describe the solution you'd like When we new a mongo collection, add a bsonOption called UseLocalTimeZone: true.