mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
MongoDB Class, fixed bug in GetCountSortedByField
This commit is contained in:
parent
a241de09e1
commit
38795d48cb
@ -1191,14 +1191,11 @@ class LogStreamMongoDB extends LogStream {
|
||||
{
|
||||
// Sort Array
|
||||
arsort($aResult,SORT_NUMERIC);
|
||||
|
||||
// Check if we have to truncate the array
|
||||
if ($nRecordLimit != 0 && count($aResult) > $nRecordLimit)
|
||||
{
|
||||
// Create new stripped array
|
||||
$aStripResult = array ();
|
||||
for($iCount = 0; $iCount < $nRecordLimit; $iCount++)
|
||||
$aStripResult[$iCount] = $aResult[$iCount];
|
||||
// Slice all unecessary entries from array!
|
||||
$aStripResult = array_slice($aResult, 0, $nRecordLimit);
|
||||
|
||||
// Overwrite stripped results
|
||||
$aResult = $aStripResult;
|
||||
|
Loading…
x
Reference in New Issue
Block a user