Skip to content

fix(collection): allow { upsert: 1 } for findOneAndUpdate() and update() - #1593

Merged
mbroadst merged 1 commit into
3.0.0from
fix/collection/port-1580
Dec 4, 2017
Merged

fix(collection): allow { upsert: 1 } for findOneAndUpdate() and update()#1593
mbroadst merged 1 commit into
3.0.0from
fix/collection/port-1580

Conversation

@daprahamian

Copy link
Copy Markdown
Contributor

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.0

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.0
@daprahamian
daprahamian requested review from jlord and mbroadst December 4, 2017 19:12
@mbroadst
mbroadst merged commit 5bcedd6 into 3.0.0 Dec 4, 2017
@mbroadst
mbroadst deleted the fix/collection/port-1580 branch December 4, 2017 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants