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

$pull or $pullAll are not working

Open c4c1us opened this issue 4 years ago • 0 comments

Hi,

I can't believe I'm actually posting this issue but It's my last chance to fix my problem. I can't use $pullAll update operator with jest-mongo. It's working well with my actual database. But when I ran my units tests (jest), they failed because this operation is doing nothing on a mongodb memory server.

 await AccountModel.updateOne(
        { uid: userId },
        { $pullAll: { fcmTokens: fcmTokens }, $set: { nickname: "ooo" } }
      ).exec();

Here is my code sample, the $set operation is done but not the $pullAll.

node v14.15.1

    "@shelf/jest-mongodb": "^1.2.3",
   "mongoose": "^5.11.15",

c4c1us avatar Feb 04 '21 19:02 c4c1us