Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $projectStep = array(
  2. 'report_id' => 1,
  3. 'space' => 1,
  4. 'location' => array(
  5. 'type' => 'Point',
  6. 'coordinates' => array('$longitude', '$latitude')
  7. ),
  8. 'altitude' => 1,
  9. 'data' => 1
  10. );
  11.  
  12. foreach ($collections as $coll) {
  13. $outname = "{$coll}_geospatial";
  14.  
  15. $pipeline = array(
  16. array('$project' => $projectStep ),
  17. array('$out' => $outname)
  18. );
  19.  
  20. $coll = $db->selectCollection($collection);
  21. $coll->aggregate($pipeline);
  22. }
  23.  
  24. exception 'MongoDBDriverExceptionConnectionTimeoutException' with message 'Failed to send "aggregate" command with database: Failed to read 4 bytes: socket error or timeout'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement