Fixed some filtering issues

This commit is contained in:
Andre Lorbach 2012-04-05 12:52:23 +02:00
parent 8ca3e0db1e
commit 0e12ccf409

View File

@ -1456,7 +1456,6 @@ TODO!!!
{ {
$szMongoPropID = $dbmapping[$szTableType]['DBMAPPINGS'][$propertyname]; $szMongoPropID = $dbmapping[$szTableType]['DBMAPPINGS'][$propertyname];
print_r ( $myfilter );
switch( $myfilter[FILTER_TYPE] ) switch( $myfilter[FILTER_TYPE] )
{ {
case FILTER_TYPE_STRING: case FILTER_TYPE_STRING:
@ -1500,10 +1499,10 @@ TODO!!!
{ {
if ( $propertyname == SYSLOG_MESSAGE ) if ( $propertyname == SYSLOG_MESSAGE )
// If we filter for Syslog MSG, we use $ALL to match all values // If we filter for Syslog MSG, we use $ALL to match all values
$this->_myMongoQuery[ $szMongoPropID ]['$all'][] = $myfilter[FILTER_VALUE]; $this->_myMongoQuery[ $szMongoPropID ]['$regex'][] = $myfilter[FILTER_VALUE]; // Using REGEX for now!
else else
// We use $in by default to get results for each value // We use $in by default to get results for each value
$this->_myMongoQuery[ $szMongoPropID ]['$in'][] = $myfilter[FILTER_VALUE]; $this->_myMongoQuery[ $szMongoPropID ]['$regex'][] = $myfilter[FILTER_VALUE]; // Using REGEX for now!
} }
else else
// $ne equals NOT EQUAL // $ne equals NOT EQUAL
@ -1587,7 +1586,6 @@ TODO!!!
} }
} }
} }
} }
//print_r ( array('x' => array( '$gt' => 5, '$lt' => 20 )) ); //print_r ( array('x' => array( '$gt' => 5, '$lt' => 20 )) );
@ -1866,12 +1864,11 @@ TODO!!!
$myCursor = $myCursor->sort(array("_id" => -1)); $myCursor = $myCursor->sort(array("_id" => -1));
// Copy rows into the buffer! // Copy rows into the buffer!
$iBegin = $this->_currentRecordNum; $iBegin = $this->_currentRecordNum;
// while ($myCursor->hasNext() && $myRow = $myCursor->getNext()) // while ($myCursor->hasNext() && $myRow = $myCursor->getNext())
foreach ($myCursor as $myRow) foreach ($myCursor as $mongoid => $myRow)
{ {
// Check if result was successfull! // Check if result was successfull! Compare the queried uID and the MONGOID to abort processing if the same ID was returned! Otherwise we have dupplicated results at the end
if ( $myRow === FALSE || !$myRow ) if ( $myRow === FALSE || !$myRow || $uID == base_convert($mongoid, 16, 10) )
break; break;
// Convert ID from HEX back to DEC // Convert ID from HEX back to DEC