for (var i = 200; i <210 ; i++) { db.getCollection("tb_table").insert({ "level": NumberInt(1), "appTuid": "20230210-151329-8759-19227", "title": "自动化-0419-"+i, "content": "自动化-0419-"+i, "customParameters": "{'news_id': 134,'my_key': 'a value'}", "messageType": NumberInt(2), "sendTime": NumberLong("1683536622470"), "failSendCount": NumberInt(0), "sendState": NumberInt(1), "sendDesc": "待发送", "sendBody": "", "createBy": "20200917-134421-8819-97993", "createDate": NumberLong("1683536622470"), "updateBy": "20200917-134421-8819-97993", "updateDate": NumberLong("1683536622470"), "_class": "org.saic.dre.repository.message.model.device.AssignDeviceMessageEntity" }) }
mongo也可用for循环实现数据批量插入
标签:200,mongo,批量,MongoDB,插入,数据 From: https://www.cnblogs.com/zhaoboyuanyuan/p/17391848.html