[GODRIVER-1821] Different with $addToSet in NodeJS and Go drivers Created: 04/Jan/21 Updated: 06/Jan/21 Resolved: 06/Jan/21 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 1.4.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Hodel | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
There is a problem between the nodejs driver and the go driver with $addToSet, why would they be different when the company mongo is making them?
The nodejs driver will replace the field in the document, the go driver will not.
For example if you are using $addToSet on a field that has an existing string... the nodejs driver would replace it with an array and the go driver returns an error.
That makes anyone who writes in node first have a problem with the interpretation of how the driver works. Why would they be different? |
| Comments |
| Comment by Kevin Albertson [ 06/Jan/21 ] |
|
Closing as duplicate, since the conversation has continued in |
| Comment by Andrew Hodel [ 05/Jan/21 ] |
|
@kevin I guess I can't talk to you with structure.
I'll comment on the other issue. |
| Comment by Andrew Hodel [ 04/Jan/21 ] |
|
There are a lot of people who think overwriting a null value is normal you know... |
| Comment by Andrew Hodel [ 04/Jan/21 ] |
|
It is worse, it won't even overwrite a null value in the field!
[{write errors: [ {Cannot apply $addToSet to non-array field. Field named 'outsideIp' has non-array type null}]}
Do you really think that's acceptable? |