Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1103

Fatal error: Uncaught exception 'MongoCursorException' with message 'someserver.com:27017: Can't canonicalize query: BadValue bad geo query' in /var/www/html/one-call/lib/somefile.php:97

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: pecl-mongo
    • # Replies:
      5
    • Last comment by Customer:
      true

      Description

      Using Code :

       $mongo = new MongoClient("mongodb://someserver.com:27017");
          $marks = $mongo->selectDB('atlantic');
              $q = array('bounds' => array(
                '$geoWithin' => array(
                    '$geometry' => array(
                        'type' => 'Polygon',
                  'coordinates' => array(array(
                          array(40.125246,-74.327963),
                          array(40.125246,-74.325989),
                          array(40.123738,-74.325989),
                          array(40.123738,-74.327963),
                          array(40.125246,-74.327963)
                  ))
                    )
                )
             )
          );
      $marks = new MongoCollection($marks,'Analyzer_Marks');
          $marks = $marks->find($q);
          //var_dump($marks);
          $results = array();
          if(!empty($marks)){
       
              foreach($marks as $mark) {
                  $results[] = array(
                      "location" => $mark['location'],
                      "tile" => $mark['tile'],
                      "status" => $mark['status']
                  );
              }
          }

      Keep Getting Error

      Fatal error: Uncaught exception 'MongoCursorException' with message 'someserver.com:27017: Can't canonicalize query: BadValue bad geo query' in /var/www/html/one-call/lib/somefile.php:97

      Tried Adding Another Array Call and keep getting errors

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            durbanp800x dan
            Participants:
            Last commenter:
            Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              6 years, 13 weeks ago
              Date of 1st Reply: