Commit 5bcedd6
fix(collection): allow { upsert: 1 } for findOneAndUpdate() and update()
This is a very rough edge in the API where findAndModify() treats upsert: 1
as upsert: true, but findOneAndUpdate() and updateX() treat upsert: 1
as upsert: false. CRUD spec does say upsert is a boolean but we've had
upsert: 1 in shell examples for a while so it may be worthwhile to support
both, especially since truthiness is so common in JS.
Port of #1580 to 3.0.01 parent 4a0cfeb commit 5bcedd6
1 file changed
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
1018 | | - | |
| 1017 | + | |
| 1018 | + | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| |||
2124 | 2124 | | |
2125 | 2125 | | |
2126 | 2126 | | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
| 2127 | + | |
| 2128 | + | |
2130 | 2129 | | |
2131 | 2130 | | |
2132 | 2131 | | |
| |||
0 commit comments