|
|
|
|
|
by tantalor
3612 days ago
|
|
One case where this question is important is when you are updating a record stored by the server. You only want to send fields you are changing because the record might be huge. But then how does the server distinguish between fields you didn't set and fields you want to set back to the default? The solution is to also tell the server which fields you are changing in a separate message. Example: {
'update_record': {
# Set foo=bar
'foo': 'bar'
},
'fields_to_update': {
'foo': true,
# Set some_int_flag=0 (default)
'some_int_flag': true
}
}
See also "Field Masks in Update Operations"
https://developers.google.com/protocol-buffers/docs/referenc... |
|