您好,登錄后才能下訂單哦!
這篇文章主要介紹mongodb數(shù)據(jù)如何生成Insert語句,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
執(zhí)行:
db.getCollection('cap.published').find({}).forEach(function(item){ print( 'db.getCollection("cap.published").insert(' + tojson(item) + ');' ); });
返回結(jié)果:
db.getCollection("cap.published").insert({ "_id" : NumberLong("1102078858484363264"), "Name" : "order.rabbitmq.mongodb", "Content" : "{\"Id\":\"5c7b668a61ff69508c6804e4\",\"Timestamp\":\"2019-03-03T13:30:50.1988102+08:00\",\"Content\":\"2019/3/3 13:30:50\",\"CallbackName\":null}", "Added" : ISODate("2019-03-03T05:30:50.151Z"), "ExpiresAt" : null, "Retries" : 0, "StatusName" : "Scheduled", "Version" : "v1" }); db.getCollection("cap.published").insert({ "_id" : NumberLong("1102079247510253568"), "Name" : "order.rabbitmq.mongodb", "Content" : "{\"Id\":\"5c7b66e661ff69508c6804e7\",\"Timestamp\":\"2019-03-03T13:32:22.9051009+08:00\",\"Content\":\"2019/3/3 13:32:22\",\"CallbackName\":null}", "Added" : ISODate("2019-03-03T05:32:22.905Z"), "ExpiresAt" : null, "Retries" : 0, "StatusName" : "Scheduled", "Version" : "v1" }); db.getCollection("cap.published").insert({ "_id" : NumberLong("1102080584656740352"), "Name" : "order.rabbitmq.mongodb", "Content" : "{\"Id\":\"5c7b682561ff692e5cdee269\",\"Timestamp\":\"2019-03-03T13:37:41.9368025+08:00\",\"Content\":\"2019/3/3 13:37:41\",\"CallbackName\":null}", "Added" : ISODate("2019-03-03T05:37:41.699Z"), "ExpiresAt" : null, "Retries" : 0, "StatusName" : "Scheduled", "Version" : "v1" }); db.getCollection("cap.published").insert({ "_id" : NumberLong("1102081814329499648"), "Name" : "order.rabbitmq.mongodb", "Content" : "{\"Id\":\"5c7b694a61ff69321cd19bc4\",\"Timestamp\":\"2019-03-03T13:42:34.933565+08:00\",\"Content\":\"2019/3/3 13:42:34\",\"CallbackName\":null}", "Added" : ISODate("2019-03-03T05:42:34.879Z"), "ExpiresAt" : null, "Retries" : 0, "StatusName" : "Scheduled", "Version" : "v1" }); db.getCollection("cap.published").insert({ "_id" : NumberLong("1102082932053180416"), "Name" : "order.rabbitmq.mongodb", "Content" : "{\"Id\":\"5c7b6a5561ff692ef44a8c2b\",\"Timestamp\":\"2019-03-03T13:47:01.4290666+08:00\",\"Content\":\"2019/3/3 13:47:01\",\"CallbackName\":null}", "Added" : ISODate("2019-03-03T05:47:01.366Z"), "ExpiresAt" : null, "Retries" : 0, "StatusName" : "Scheduled", "Version" : "v1" });
以上是“mongodb數(shù)據(jù)如何生成Insert語句”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。