[CDRIVER-2317] Overwrite Fields in BSON Created: 06/Oct/17 Updated: 27/Oct/23 Resolved: 07/Oct/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Victor Stewart | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Very often I find myself needing to reinit a bson_t just to change 1 field. Lots of unnecessary operations! It would be great if fields could be overwritten. Maybe an explicit overwrite option, so there is no search overheard with append operations. |
| Comments |
| Comment by Victor Stewart [ 07/Oct/17 ] | |||||
|
forgive my ignorance, thank you! | |||||
| Comment by A. Jesse Jiryu Davis [ 07/Oct/17 ] | |||||
|
If a field is of fixed size (int32, int64, bool, decimal128, or double) then you can overwrite it whenever you want:
You can keep a bson_iter_t struct pointing at the field you want to change - an iterator is valid for as long as the bson_t is valid. |