phplib

Error implementing simple Pagination with skip() and limit() in MongoDB PHP driver and related PHPLib library

荒凉一梦 提交于 2019-12-11 17:47:52
问题 I am trying to implement pagination when accessing data from MongoDB using PHP. In MySQL, I would have used OFFSET and LIMIT . My Google search told me that the alternative of PHP-MongoDB is skip() and limit() . But when I try to use those functions, I get a fatal error. Here is the error: Fatal error: Uncaught Error: Call to undefined method MongoDB\Driver\Cursor::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