php and javascript class to filter elements in collection based on json filters with a mongoQuery like syntax