Optionally support $toObjectId
in MongoDB adapter
#1402
0x557269656C
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Community 👋🏻
After upgrading to the latest version of the library, I've appreciated the decoupling of mongoose models, however in my setup I needed to support
ObjectId
and had to virtual (monkey) patch my MongoDB adapter'sgetSessionAndUser()
.This sort of patching is not ideal and I recognise there may be hesitance to introduce further customisation options to the MongoDB adapter, but given that this particular change could be driven by an optional pipeline stage such as:
Would it be proper to include an option like
{coerceObjectId: true}
(or a suitable naming alternative) to facilitate this?Perhaps the option to provide a custom pipeline?
Looking forward for your takes on this, thank you all for your time!
Beta Was this translation helpful? Give feedback.
All reactions