Fawn icon indicating copy to clipboard operation
Fawn copied to clipboard

How to retrieve values returned by a task.update() ?

Open J-DreaMy opened this issue 4 years ago • 1 comments

task.update(House, { _id: id }, { latitude, longitude }, { new: true });
task.update(UserHouse, { _id: userHouse.id }, { houseName }, { new: true });
const results = await task.run({ useMongoose: true });
return { house: results[0], userHouse: results[1] };

it will return me like this

        "house": {
            "n": 0,
            "nModified": 0,
            "ok": 1
        },
        "userHouse": {
            "n": 1,
            "nModified": 1,
            "ok": 1
        }

J-DreaMy avatar Nov 12 '19 09:11 J-DreaMy

I am also facing this issue. After update i don't get latest data which is important

pavelsust avatar Jul 14 '20 20:07 pavelsust