I have mongodb documents like this
[_id] => MongoId Object (
[$id] => 52135a6baabacb9f948b4567
)
[change] => 7
[from] => 8
[to] => 1
How to select documents with field "from" greater than "to" in MongoDB? I tried something like this but it doesn't work at all.
$collection->find( array('from' => array('$gt' => 'to') ) );