婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > mongodb exception: $concat only supports strings, not NumberInt32解決辦法

mongodb exception: $concat only supports strings, not NumberInt32解決辦法

熱門標簽:智能電銷機器人銷售話術 兗州電話外呼營銷系統(tǒng) 沈陽營銷電銷機器人招商 高德地圖標注商戶位置 南京400電話怎樣辦理 福州電銷機器人源代碼 企業(yè)智能外呼系統(tǒng)價格多少 徐州ai電銷機器人原理 機器人外呼系統(tǒng)軟件存在問題

今天在用mongodb操作aggregation的時候出現(xiàn)這個問題,我是想格式化日期,例如”2013-10-17 04:41:37 UTC”變成”10月17日”,

復制代碼 代碼如下:

'fdate' => { '$concat' => ['$date.month', '月', '$date.day', '日'] }

出現(xiàn) exception: $concat only supports strings, not NumberInt32

原來$concat只能操作字符串,不支持數(shù)字類型,解決辦法是用$substr

復制代碼 代碼如下:

$date形如'2013-10-13 11:17:18 UTC'

'fdate' => { '$concat' => [ {$substr=>['$date', 5, 2]}, '月', {$substr=>['$date', 8, 2]}, '日'] }


$substr接受兩個參數(shù),一個是字符串的起點,一個是截取的字符串的長度。

您可能感興趣的文章:
  • go語言中的interface使用實例
  • Go語言interface詳解
  • mongodb錯誤tcmalloc: large alloc out of memory, printing stack and exiting解決辦法
  • golang實現(xiàn)unicode轉(zhuǎn)換為字符串string的方法
  • Go語言string,int,int64 ,float之間類型轉(zhuǎn)換方法

標簽:鶴崗 吉安 本溪 景德鎮(zhèn) 邯鄲 大理 丹東 昭通

巨人網(wǎng)絡通訊聲明:本文標題《mongodb exception: $concat only supports strings, not NumberInt32解決辦法》,本文關鍵詞  mongodb,exception,concat,only,;如發(fā)現(xiàn)本文內(nèi)容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《mongodb exception: $concat only supports strings, not NumberInt32解決辦法》相關的同類信息!
  • 本頁收集關于mongodb exception: $concat only supports strings, not NumberInt32解決辦法的相關信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 晋宁县| 故城县| 新田县| 南岸区| 株洲县| 四川省| 墨玉县| 周宁县| 钦州市| 阿城市| 安义县| 林口县| 新田县| 孟津县| 宁城县| 景泰县| 江孜县| 鄂伦春自治旗| 青海省| 会宁县| 长岭县| 临洮县| 额尔古纳市| 克东县| 固始县| 儋州市| 黎川县| 舟曲县| 邹城市| 辽宁省| 扎赉特旗| 泸水县| 济宁市| 稻城县| 盈江县| 新乡市| 东乌珠穆沁旗| 苏州市| 吉林市| 密山市| 准格尔旗|