Groups
Sign in
Groups
node-mongodb-native
Conversations
About
Send feedback
Help
Unexpected behavior when index creates without callback
11 views
Skip to first unread message
r.u.go...@gmail.com
unread,
Dec 23, 2017, 3:26:04 AM
12/23/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to node-mongodb-native
Hi.
I wanted to create unique index and used the callback approach first:
code -
https://gyazo.com/8d3e2da0901827e097a0da1e10069489
It works fine, and unique index created:
console -
https://gyazo.com/fff078991e2da79ffd72921f41a24fcc
mlab -
https://gyazo.com/ea1e71ecd51f87a31329cb3e59be7c30
But, if I use promise instead:
code -
https://gyazo.com/f23b5c147e6a50b2e6fffb0c16f6014d
There are no errors, but created index doesn't have uniqueness:
console -
https://gyazo.com/7b6484cf1e44248fedb096b3f762f1e3
mlab -
https://gyazo.com/a6db7b0173e57f74f00e7f3fa96e6785
If I use
.then
instead
async/await
- the same result.
Is it bug or I just didn't get some part of docs?
r.u.go...@gmail.com
unread,
Dec 23, 2017, 4:35:42 PM
12/23/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to node-mongodb-native
So, I wrote my own promise and it works as expected:
code -
https://gyazo.com/f83282644299320607904874c89827c1
Reply all
Reply to author
Forward
0 new messages