RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
【mongo】mongo字段类型互转
mark一下
参考:
https://blog.csdn.net/laoyang360/article/details/72594344

1.str转long

  1. 当int很长时
  2. db.teststatement.find({"ctime":{$type: 2}}).forEach( function (x) {
  3.   x.ctime= NumberLong(x.ctime);
  4.   db.teststatement.save(x);
  5. })

2.int转str

  1. db.redefine_share_backwards.find( { 'share_uid' : { $gte : 0 } } ).forEach( function (x) { 
  2.  x.share_uid= ""+x.share_uid;
  3.  db.redefine_share_backwards.save(x);
  4. })



文章标题:【mongo】mongo字段类型互转
当前URL:http://sczitong.cn/article/iiogci.html