uuid-mongodb icon indicating copy to clipboard operation
uuid-mongodb copied to clipboard

MUUID.from() fails with CastError

Open TisRyno opened this issue 4 years ago • 1 comments

v2.4.3 introduces: CastError: Cast to Buffer failed for value "new Binary(Buffer.from("bd8b82fd91604ebc8010f5026c0b1644", "hex"), 4)" at path "centre" for model "Queue"

The code where it fails is as simple as:

const rows = await MQueue.find({
    centre: MUUID.from(uuid),
    deletedAt: null
})

I can confirm that reverting to v2.4.2 fixes the issue

TisRyno avatar Apr 28 '21 10:04 TisRyno

I have this problem with mongoose 6.0.5. Working with 5.12.2.

uuid-mongodb 2.4.2 doesn't fix this.

So... npm i [email protected] ;-)

xairoo avatar Sep 12 '21 14:09 xairoo