mongoose-to-swagger icon indicating copy to clipboard operation
mongoose-to-swagger copied to clipboard

Exclude specific fields

Open timvol opened this issue 4 years ago • 1 comments

Sorry for my ignorance, but how can I exclude a specific field from being exported? In my case, I want exclude the "_id" field because it's automatically generated. Is it supported?

timvol avatar May 06 '20 16:05 timvol

@timvol Update this line const omitted = new Set(['__v']); to this const omitted = new Set(['__v', '_id']); if you want to remove _id

kkomaragiri avatar Oct 15 '20 17:10 kkomaragiri