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"
}
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"
}