ParticipioLabs / plato-core

Shared code between Plato Project apps
https://www.platoproject.org/eng
1 stars 0 forks source link

Re-export mongoose types? #1

Closed Powersource closed 3 years ago

Powersource commented 3 years ago

When I want to create e.g. an orgMember, I need to create an ObjectId for the organizationId, and then I need to import mongoose. Which is installed by this project but not directly by mine. So would be nice if I could import the needed types from this project instead

gustavlrsn commented 3 years ago

I think you should be able to use a string as organizationId directly, and mongoose will cast it to an ObjectId

Powersource commented 3 years ago

Ah nice yeah that seems to work! Funny that no one on stackoverflow would mention that