[SERVER-1198] BSONObjBuilder.merge( BSONObj o ) - add fields not already there Created: 07/Jun/10 Updated: 24/Feb/17 Resolved: 24/Feb/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | 1.5.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andrea Fontana | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
If we have some BSONObj with similar structure and we append them using the same BSONObjBuilder, the resulting BSONObjectBuilder.obj() is malformed... For example: BSONObj o[5] = ; BSONObjBuilder b; Resulting object from builder have three different 'subobj' fields. And if you insert this obj in database these three fields become identical (and repeated). It would be useful if BSONObjBuilder could merge objects overwriting similar fields, so the previous code will gives an object like this: { , and not like this one (current behaviour): { , , , if you insert this object in db, and then you retrieve it, you'll read: { , , , |
| Comments |
| Comment by Eric Milkie [ 24/Feb/17 ] |
|
The legacy C++ driver is no longer in active development. |