In terminal, this returns what I want:
db.test.find({"sessions": {"$gt":5}, "n_friends":{"$lt":5}});
However in PHP, I have not been successful yet. The last thing I've tried looked like this:
$query = $collection->find( array(
'sessions' => array( '$gt' => 1 ),
'$and' => array('n_friends' => array( '$lt' => 50 ) ) ) );
:becomes=>in PHP, and the{}becomearray()