Dynamically set all properties of an extended class as not required #791
Replies: 3 comments 2 replies
-
no this is not supported by typegoose - you will have to "duplicate" code (also typegoose will likely never support such a thing) if you really want to map properties, then you can try to manually build the schema and add a mapper in-between (or use a plugin to map it) |
Beta Was this translation helpful? Give feedback.
-
@PinkFromTheFuture i faced same request, wondering how did you resolve it? did you duplicate code? |
Beta Was this translation helpful? Give feedback.
-
Yeah, Prisma.
But I believe that TypeORM would also be a solid choice.
…On Fri, Jan 5, 2024 at 9:40 AM Mike Koval ***@***.***> wrote:
wondering what ORM do you use to work relational database? Prisma?
—
Reply to this email directly, view it on GitHub
<#791 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSWIJIDQQCOGVK7H2QT6ITYM7YCDAVCNFSM6AAAAABBNAMS3KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DAMRSHAYTC>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
<http://t-rize.io>
Eduardo Furtado
Chief Technology Officer
T-RIZE Group <http://t-rize.io>
***@***.***
+1 (800) 617 0366, Extension 704 <+18006170366,704>
2500-1155 René-Lévesque Blvd W,
Montréal, QC, Canada, H3B 3X7 <https://goo.gl/maps/HbJRqaRZ7EhkPimT8>
<https://www.linkedin.com/in/pinkfromthefuture/>
<https://github.com/PinkFromTheFuture>
Avis de confidentialité : Ce courriel et les pièces qui y sont jointes
contiennent de l'information confidentielle et peuvent être protégés par le
secret professionnel ou constituer de l’information privilégiée. Ils sont
destinés à l'usage exclusif de la (des) personne(s) à qui ils sont
adressés. Si vous n'êtes pas le destinataire visé ou la personne chargée de
transmettre ce document à son destinataire, vous êtes avisé par la présente
que toute divulgation, reproduction, copie, distribution ou autre
utilisation de cette information est strictement interdite. Si vous avez
reçu ce courriel par erreur, veuillez en aviser immédiatement l’expéditeur
par courriel ainsi que détruire et effacer l'information que vous avez
reçue de tout disque dur ou autre média sur lequel elle peut être
enregistrée et ne pas en conserver de copie. Merci de votre collaboration.
Notice of Confidentiality: This electronic mail message, including any
attachments, is confidential and may be privileged and protected by
professional secrecy. They are intended for the exclusive use of the
addressee. If you are not the intended addressee or the person responsible
for delivering this document to the intended addressee, you are hereby
advised that any disclosure, reproduction, copy, distribution or other use
of this information is strictly forbidden. If you have received this
document by mistake, please immediately inform the sender by email, destroy
and delete the information received from any hard disk or any media on
which it may have been registered and do not keep any copy. Thank you for
your cooperation.
|
Beta Was this translation helpful? Give feedback.
-
In the code below, how I can have all the properties of EntityRequest as not required (required: false) without having to duplicate code?
I am extending the Entity model to define the EntityRequest model.
Both models should be the same, with the exception that all properties of EntityRequest should be not required.
The goal is to not repeat code. In other words, by dynamically making it so that every property of Entity will be considered in EntityRequest, without having to write code specifically for each of them. For example, the code of EntityRequest
should be replaced by something like
Beta Was this translation helpful? Give feedback.
All reactions