db.mongo.insert({name:'mongo'});>vart=db.mongo.findOne();>t{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo"}>vard=t>d{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo"}>d.password=123123>d{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo","password":123}>t{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo","password":123}问题1vard=t是引用赋值吗如果是的话,怎么样不使用引用赋值deleted.passwordtrue>d{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo"}>d.password=124124>d{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo","password":124,"password":124}问题2我执行deleted.password返回true说明已经删除,为什么我再执行d.password=124会执行两次添加>d{"_id":ObjectId("5141b98723616e67f947f356"),"name":"mongo","password":124,"password":124}刚开始接触不是很明白,希望有知道的说明下原因
繁星coding
相关分类