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
- 一次OutOfMemoryError: GC overhead limit exceededErrorGCMIT
- influxdb報錯:cache-max-memory-size exceededUX
- php執行的時候報File size limit exceededPHPMIT
- 記一次 報錯:Android ClassNotFoundException: Didn't find class on pathAndroidException
- 【BUG系列】multiDexEnabled true 不能亂寫啊,ClassNotFoundException: Didn't find class "***IDEException
- Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’None
- 【idea】編譯java專案時出現java.lang.OutOfMemoryError: GC overhead limit exceededIdea編譯JavaErrorGCMIT
- redis : Can't save in background: fork: Cannot allocate memoryRedis
- 手動寫java OOM記憶體溢位 java.lang.OutOfMemoryError: GC overhead limit exceededJavaOOM記憶體溢位ErrorGCMIT
- 域滲透——Pass The Hash & Pass The Key
- 【MAC版】Eclipse中啟動genymotion虛擬機器 顯示:Android ADB server didn't ACK 解決辦法MacEclipse虛擬機AndroidServer
- 解決laravel出現Syntax error or access violation: 1055 ‘***‘ isn‘t in GROUP BYLaravelError
- Redshift建立外部架構external schema和外部表external table架構
- 解決yarn打包時出現“FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory”的問題YarnErrorMITAIJavaScript
- Vim tips——Working with external commands
- No ‘Access-Control-Allow-Origin’ headerHeader
- memory
- linux limit限制LinuxMIT
- 極限limitMIT
- ORA-00800: soft external errorError
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:AVAILABILITY GROUP ON子句SQLServerAI
- Lock wait timeout exceeded; try restarting transactionAIREST
- 域滲透——Pass The Ticket
- Battle Pass的本質BAT
- LLVM PASS PWN 總結LVM
- set_time_limitMIT
- Mysql LIMIT的用法MySqlMIT
- BMZCTF:memory
- External Pricing in C4C and ERP
- [20210305]Oracle Rolling Invalidate Window Exceeded(3).txtOracle
- [AlwaysOn] 建立SQL Server高可用性組T-SQL語法:group_name引數SQLServer
- [Memory Leak] 1. console.log cause memory leak
- VM warning: INFO: OS::commit_memory Cannot allocate memoryMIT
- MySQL中limit的用法MySqlMIT
- DMSQL LIMIT限定條件SQLMIT
- memory-cnblog
- Memory Management in RustRust