Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $projectStep = array(
- 'report_id' => 1,
- 'space' => 1,
- 'location' => array(
- 'type' => 'Point',
- 'coordinates' => array('$longitude', '$latitude')
- ),
- 'altitude' => 1,
- 'data' => 1
- );
- foreach ($collections as $coll) {
- $outname = "{$coll}_geospatial";
- $pipeline = array(
- array('$project' => $projectStep ),
- array('$out' => $outname)
- );
- $coll = $db->selectCollection($collection);
- $coll->aggregate($pipeline);
- }
- 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