db.eval(); Error changes after upgrade

  mongodb, question

The normally available scheduled task suddenly reported an error, and the error changed again after mongodb upgrade.

Upon examination, the following statement was found to be in error:

MongoDB='./mongo -u*** -p***'
 $MongoDB <<EOF
 use logReportDB

The log information before upgrade is:

MongoDB shell version: 2.4.8
 connecting to:
 switched to db logReportDB
 Thu Apr 13 06:30:01.970 {
 "errmsg" : "exception: Error: attempted to insert an empty array at src/mongo/shell/collection.js:201",
 "code" : 16722,
 "ok" : 0
 } at src/mongo/shell/db.js:571

The upgraded log information is:

MongoDB server version: 3.4.2
 switched to db logReportDB
 WARNING: db.eval is deprecated
 2017-05-11T06:30:01.838+0800 E QUERY    [thread1] Error: {
 "ok" : 0,
 "errmsg" : "Error: remove needs a query :\nDBCollection.prototype._parseRemove@src/mongo/shell/collection.js:409:1\  nDBCollection.prototype.remove@src/mongo/shell/collection.js:434:18\n____MongoToSM_newFunction_temp@:11:1\n_funcs1@:1:31\n",
 "code" : 139,
 "codeName" : "JSInterpreterFailure"
 } :

At present, there is no way to deal with it. I hope the Great Spirit can teach me.

I have encountered such a situation, how to solve it?