Exceeded memory limit for $group, but didn't allow external sort. Pass allowDisk
原語句:
db.carMongoDTO.aggregate({'$group':{'_id': {'licensePlates': '$licensePlates'},'uniqueIds': {'$addToSet': '$_id'},'count' : {'$sum': 1}}}, {'$match': {'count': {'$gt': 1}}})
Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in
原因是聚合的結果必須要限制在16M以內操作,(mongodb支援的最大影響資訊的大小),否則必須放在磁碟中做快取( allowDiskUse=True )
修改為:
db.carMongoDTO.aggregate([{'$group':{'_id': {'licensePlates': '$licensePlates'},'uniqueIds': {'$addToSet': '$_id'},'count' : {'$sum': 1}}},{'$match': {'count': {'$gt': 1}}},{ "$limit" : 10}],{ allowDiskUse: true })
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28939273/viewspace-2660440/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Sybase IQ 錯誤 : Temporary space limit exceededMIT
- TNS-00510 Internal limit restriction exceededMITREST
- 一次OutOfMemoryError: GC overhead limit exceededErrorGCMIT
- ORA-19809: limit exceeded for recovery filesMIT
- ORA-19566: exceeded limit of 0 corrupt blocks for fileMITBloC
- Mac osx 安裝PIL出現Some externally hosted files were ignored (use --allow-external PIL to allow).Mac
- php執行的時候報File size limit exceededPHPMIT
- influxdb報錯:cache-max-memory-size exceededUX
- 解決Android Studio出現GC overhead limit exceededAndroidGCMIT
- Didn't find class "android.support.v7.widget.RecyclerView"AndroidView
- 100 Things You Probably Didn't Know About Oracle DatabaseOracleDatabase
- ORA-19566 exceeded limit of 0 corrupt blocks資料壞塊處理MITBloC
- RMAN備份時出現ORA-19809: limit exceeded for recovery filesMIT
- Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’None
- 【BUG系列】multiDexEnabled true 不能亂寫啊,ClassNotFoundException: Didn't find class "***IDEException
- 記一次 報錯:Android ClassNotFoundException: Didn't find class on pathAndroidException
- org.dbunit.dataset.NoSuchTableException: t_groupException
- redis : Can't save in background: fork: Cannot allocate memoryRedis
- MongoDB報錯:"assertion" : "can't map file memory"MongoDB
- RMAN出現檔案損壞ORA-19566: exceeded limit of 0 corrupt blocks 處理MITBloC
- 2008.1.15 He didn't know it until I put a bug in his ear.
- 手動寫java OOM記憶體溢位 java.lang.OutOfMemoryError: GC overhead limit exceededJavaOOM記憶體溢位ErrorGCMIT
- 【idea】編譯java專案時出現java.lang.OutOfMemoryError: GC overhead limit exceededIdea編譯JavaErrorGCMIT
- External Views (33)View
- llvm passLVM
- 解決laravel出現Syntax error or access violation: 1055 ‘***‘ isn‘t in GROUP BYLaravelError
- Redshift建立外部架構external schema和外部表external table架構
- sqlldr與external tableSQL
- MySQL LIMIT 如何改寫成Oracle limitMySqlMITOracle
- 解決yarn打包時出現“FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory”的問題YarnErrorMITAIJavaScript
- oracle 外部表 external tableOracle
- Oracle外部表 External TableOracle
- ORACLE_DATAPUMP & External TableOracle
- Parallel Access to External Tables (173)Parallel
- 【MAC版】Eclipse中啟動genymotion虛擬機器 顯示:Android ADB server didn't ACK 解決辦法MacEclipse虛擬機AndroidServer
- Battle Pass的本質BAT
- jquery pass parameter to ajax callbackjQuery
- http://pass.com.ru/HTTP