-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid generation sub doc type of the map #169
Comments
just filtering made another problem. added |
Hey @d3m3vilurr are you sure this is valid Mongoose syntax? See what ChatGPT said about it: https://chatgpt.com/share/677cb8c3-8804-800c-9f97-2c2df4195453 If its valid Im happy to add support for it, but want to make sure before I do |
Ive always used nested child schemas when doing this sort of logic. Seems like Mongoose docs use them too: https://mongoosejs.com/docs/schematypes.html#maps |
well.. in a special reason, I(We) use homemade internal schema transformer for making a mongoose schema (js format) then re-transform ts definition using this project. actually, I don't know it's valid or not... because, we have an experience which handling large dataset with mongoose, but usually, we don't use sub document format without a reason but still we use it. anyway, mongoose doc link said this part seems pretty related my problem. but i retest with example of the mongoose
if it works, I close this issue then fix our side :) |
it's same.
|
This latest PR should resolve the naming issue, were stripping out special characters from the Mongoose schema name now. Could you try upgrading to 9.5.1 and see if the problem persists? Again try with the subschema syntax:
|
Hi @francescov1 here is my testing subset.
and also, PS. we(our company) met another issues with mongoose |
Okay let me look further, will report back |
@d3m3vilurr Im unable to reproduce your issue, seems to work fine in my environment. Can you provide a simple repo I can run to see the problem? |
@francescov1 Hello. Sorry I'm late. https://github.com/d3m3vilurr/mongoose-tsgen-169-testcase here is testcase repo. |
@d3m3vilurr been a bit swamped with a move and new job, will try to get to by end of weekend |
no problem. we are in lunar new year holiday break. thank you for your supporting & congrats new job. |
Hi. I got a trouble to transform a map type /w mongoose 8.9.3 & tsgen 9.5.0 (I used mongoose 8.6.2 & tsgen 9.2.10 before)
here is test snippet
a problem is getSubdocName's path contains
$*
. (in this case, it wastest.inner_map.$*
)so, simple dirty hack was just filter the
$*
after split a path. (.filter((v) => v !== '$*')
). but I don't know it's correct solution or not.@francescov1 can you check this issue?
The text was updated successfully, but these errors were encountered: