解析:使用php mongodb扩展时 需要注意的事项
前端之家收集整理的这篇文章主要介绍了
解析:使用php mongodb扩展时 需要注意的事项,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
最近在使用PHP的mongo 扩展进行数据统计计算,其中有一个时间戳字段,由于精确到了毫秒,长度有13位,但由于开始的时候是以字符串的形式存储:
<div class="codetitle"><a style="CURSOR: pointer" data="1252" class="copybut" id="copybut1252" onclick="doCopy('code1252')"> 代码如下:
<div class="codebody" id="code1252">
{ "_id" : ObjectId("504eea97e4b023cf38e3
4039"),"in_ts" : NumberLong("1347349143699"),"log" : { "guid" : "4D1F3079-7507-F4B0-E7AF-5432D5D8229D","p" : "View_Prop_YepPage_Zheng","cid" : "11","url" : "
http://shanghai.haozu.com/rental/broker/n/10481780","rfpn" : "Listing_V2_IndexPage_All","site" : "haozu","agent" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","stamp" : "1347349162159","cip" : "116.226.70.44","referer" : "
http://shanghai.haozu.com/shop/1464934/","cstamp" : "1347349323125","sessid" : "FA798056-F9E7-F961-41E0-CC95C850FA47","uguid" : "C00FF55B-3D3D-4B31-4318-12345B0DBE64","pn" : "View_Prop_YepPage_Zheng","cstparam" : { "proId" : NumberLong(10481780),"brokerId" : "326792","tradeType" : "2","userType" : "0","channel" : "site","entry" : "1","COMMID" : "1666" } },"out_ts" : NumberLong("1347349466083"),"rule" : 0,"status" : "ok","txid" : 0 }