mongodb - How does a json data insert as well as Mongo DB? -
this json data
0: {name: "dubai campaign", status: "active", start_time: "2017-06- 30t12:07:49+0530", id: "23842596088330291", objective: "lead_generation"} 1: { name: "onam campaign", status: "paused", start_time: "2017-06- 27t19:16:56+0530", id: "23842595270760291", objective: "lead_generation" }
how json data insert mongo db ?like
db.userdata.insert({ });
to insert multiple documents in single query, can pass array of document in insert command did follows
db.userdata.insert([{name: "dubai campaign", status: "active", start_time: "2017-06-30t12:07:49+0530", id: "23842596088330291", objective: "lead_generation"},{name: "onam campaign", status: "paused", start_time: "2017-06-27t19:16:56+0530", id: "23842595270760291", objective: "lead_generation"}])
and insert document can use db.userdata.save(yourdocument) also
Comments
Post a Comment