-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Schema with _id: false still has id #746
Comments
Hello @royibernthal I checked the code and I don't know where come from the problem. The options is correctly given to the Schema constructor. Maybe it's the id param the problem. I'll continue to investigate. |
Hey @Romakita Okay thanks. For what it's worth, it used to work a while ago. |
Damned.... I’ll check the commits xD |
Sounds like the way to go :) Were you able to repro? |
Hello @royibernthal You'll see the unit test confirm that is work as expected. See you |
Hey @Romakita Sorry for the late reply. I tested this, admittedly not via a unit test, I just logged the schema's options. I have 4 schemas that specify 3 out of those have the problem, while 1 somehow doesn't. Those 3 problematic schemas are nested inside a different model than the 1 schema that works as expected - it might be a clue to what's going on. The problem can be seen both in the database and _id property in the logged schema options (which I assume is the heart of your unit test). Just to make sure everything is clear: 3 schemas - have 1 schema - has |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm using tsed 5.34.0.
I have a model which contains a schema.
I specified { schemaOptions: { _id: false } } in the Schema decorator, so the schema shouldn't have an id.
However, I'm still seeing an _id field inside the sub-document in the database.
Any idea why?
To be fair, I'm not even sure where I got schemaOptions from, I can't find it anywhere in the docs now. Is it perhaps an obsolete way to do it?
The text was updated successfully, but these errors were encountered: