第一关
命令行输入:
mongo use mydb db.mydb.insert({_id:1,name:"李小红"})
第二关
命令行输入:
mongo use Testdb2 db. t_stu.insert([{_id:1,name:"小明",sex: "男",hobbies: ["乒乓球","羽毛球"]}, {_id:2,name:"小红",sex: "女",hobbies: ["画画","唱歌"]}]) 第三关:
命令行输入:
mongo use Testdb3 document=([{_id:1,name:"张小华",sex: "男",phone: "12356986594",hobbies: ["打篮球","踢足球","唱歌"]}]); db.stu1.insert(document) db.stu2.insert(document) db.stu3.insert(document) db.stu2.update({phone: "12356986594"},{$set:{ phone: "18356971462"}}) db.stu3.save({_id:1,name:"张晓晓",sex: "女",phone: "12365498704",hobbies: ["
|