环境: Linux js代码: 循环删除表中的数据: clear-mongodb-dialog.js print('=========BEGIN=========='); for(var i of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]){ var cursor = db[i +'_dialogs'].remove({'updatetime':{'$lte': new Date(Date.now() - 2592000000)}}); // printjson(cursor