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