How to prevent a property in mongo form being persisted in javascript?
I found a solution for this in Java world: Mongo - Ignore property from being persisted Basically, you just annotate a field with @Transient
annotation.
Let's say I have an object and I dont want to store property transient
:
{
keepA: 1,
keepB: 2,
transinet: "don't persist me"
}
So after loading from mongoDb I would get this object:
{
keepA: 1,
keepB: 2
}