Mongodb

Tutorial MongoDB

Contoh Database { firstname:"dodot", lastname:"didit", memberships: ["mem1", "mem2"], address:{ street: "jl. pramuka sokaraja", city:"banyumas" } contacts:[ {name:"brath", relationship:"friend"}, ] } Membuat Tabel > use mycustomers switched to db mycustomers > db mycustomers Membuat user db.createUser({ user:"didit", pwd:"12345", roles: ["readWrite", "dbAdmin"] }); Membuat collection / table > db.createCollection('customers'); Insert data ke collection customers > db.customers.insert({first_name:"wirog", last_name:"sebastian"}); WriteResult({ "nInserted" : 1 }) Insert 2 data > db.

Continue reading