Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fatal error: Uncaught Error: Call to undefined method MongoDBDriverCursor::skip() in /var/www/html/Tests/test_mongo_two/test.php:12 Stack trace: #0 {main} thrown in /var/www/html/Tests/test_mongo_two/test.php on line 12
- <?php
- require 'vendor/autoload.php';
- $connection = new MongoDBClient("mongodb://localhost:27017");
- $db = $connection->Traffic;
- $collection = $db->frameLengthsCollection;
- #$allDataCursor = $collection->find();
- $allDataCursor = $collection->find()->skip(25)->limit(25);
- #$allDataCursor = $allDataCursor->limit(25);
- #$allDataCursor = $allDataCursor->skip(25);
- /**
- * Prettifying (is that a word?) of data
- */
- $allDataCursorConvertedToArray = array();
- foreach ($allDataCursor as $key => $value) {
- $json = MongoDBBSONtoJSON(MongoDBBSONfromPHP($value));
- $allDataCursorConvertedToArray[] = json_decode($json, true);
- }
- /**
- * Display!
- */
- #echo "allDataCursorConvertedToArray: "; print_r($allDataCursorConvertedToArray); echo "<br><br>";
- //
- foreach ($allDataCursorConvertedToArray as $key => $value) {
- print_r($value);
- break;
- }
- ?>
Add Comment
Please, Sign In to add comment