[MongoDB] MongoDB University M102 homework 2.2 answer
MongoDB Enterprise > var temp = db.products.findOne({_id : ObjectId("507d95d5719dbef170f15c00")})
MongoDB Enterprise > temp.term_years = 3
3
MongoDB Enterprise >
MongoDB Enterprise > db.products.update({_id:temp._id},temp)
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
MongoDB Enterprise >
MongoDB Enterprise > temp.limits.sms.over_rate = 0.01
0.01
MongoDB Enterprise >
MongoDB Enterprise > db.products.update({_id:temp._id},temp)
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
MongoDB Enterprise > homework.b()
0.050.019031
MongoDB Enterprise > temp.term_years = 3
3
MongoDB Enterprise >
MongoDB Enterprise > db.products.update({_id:temp._id},temp)
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
MongoDB Enterprise >
MongoDB Enterprise > temp.limits.sms.over_rate = 0.01
0.01
MongoDB Enterprise >
MongoDB Enterprise > db.products.update({_id:temp._id},temp)
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
MongoDB Enterprise > homework.b()
0.050.019031
留言
張貼留言