I have a Spring application that uses MongoTemplate to write to MongoDB. The problem is that I want to skip empty list entity properties from persistence to save some space around the docuemnt. How can I do that?
I have a Spring application that uses MongoTemplate to write to MongoDB. The problem is that I want to skip empty list entity properties from persistence to save some space around the docuemnt. How can I do that?
When defining your schema model, you can set default: undefined config for that property.
const schema= new Schema({
property_1: { type: Array, default: undefined },
})