zoukankan      html  css  js  c++  java
  • mogodb 修改字段属性

    修改为decimal类型

    db.shopgoods.find({'Pricing.Detail':{$type:2}}).forEach(function(x){x.Pricing.Detail=NumberDecimal(x.Pricing.Detail);db.shopgoods.save(x)})
    db.shopgoods.find({'Pricing.Member':{$type:2}}).forEach(function(x){x.Pricing.Member=NumberDecimal(x.Pricing.Member);db.shopgoods.save(x)})

    type类型:

    Double 1  
    String 2  
    Object 3  
    Array 4  
    Binary data 5  
    Undefined 6 已废弃。
    Object id 7  
    Boolean 8  
    Date 9  
    Null 10  
    Regular Expression 11  
    JavaScript 13  
    Symbol 14  
    JavaScript (with scope) 15  
    32-bit integer 16  
    Timestamp 17  
    64-bit integer 18  
    Min key 255 Query with -1.
    Max key 127  

    增加字段

    db.CornGoods.update({}, {$set:{"Price.ActualMoney":0}}, {multi: true})
    db.CornOrders.update({}, {$set:{"ReceivingTime":ISODate("0001-01-01T08:00:00.000+08:00")}}, {multi: true}) 
     
     
     
  • 相关阅读:
    人月神话读书笔记
    读人月神话有感
    Codeforces 137D
    Codeforces 1138B
    <WFU暑假训练一> 解题报告
    Codeforces 1250B
    Codeforces 1038D
    Codeforces 1202D
    Codeforces 87B
    Codeforces 208C
  • 原文地址:https://www.cnblogs.com/Celebrator/p/11102563.html
Copyright © 2011-2022 走看看