This is my save operation, but the output order of the print statements is B: undefined A: 正确内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Why is the then
operation executed first? Shouldn’t it be executed after my save promise
returns?
I have specified mongoose.Promise = Promise;
I hope someone can help me solve it = =
伊谢尔伦2017-05-02 09:25:27
You got it mixed up,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
You put callback and promise together
Link description
阿神2017-05-02 09:25:27
Use return Promise.resolve(_new_replay) after successful save, do not return directly