clofus/clofus-chatbot

Couldnt add the entities

rengaprasad7 opened this issue · 2 comments

getting error msg like this.. we are using mongodb version 3.6

{"name":"MongoError","message":"Unknown modifier: $pushAll","driver":true,"index":0,"code":9,"errmsg":"Unknown modifier: $pushAll"}

We need to fix this, bcs of recent deprecation in monooose

Adding to the above answers with the following code to get you a clarity in implementing concat method. You don't need to downgrade MongoDB particularly.

Before resolving this issue, you need to keep in mind that $pushAll method has been deprecated for a long time so perhaps they get rid of it in version 3.5 and above.

But you can resolve this issue with the other alternative  — concat method.

My old code,

myArray.push(id); //breaks on DocumentDB with Mongo API because of $pushAll
has been replaced with,

myArray = myArray.concat([id]); //this uses $set so no problems

this issue is fixed and code is merged now