How to set a default value to a projected field if it is null or not exists in the mongo document using java?

How to set a default value to a projected field if it is null or field not exists in the mongo document using java?

Document:

{
"field_1" : "value_1"
"field_2": null
}

Expected Result:

{
"field_1" : "value_1"
"field_2": "my_default_value"
}

Developers concerned about default values for fields use Mongoose.
As far as projecting a value to a field see the docs

<field>: <expression>
Adds a new field or resets the value of an existing field.