Skip to content

How does sorting work in the new mongodb PECL extension? #214

@dugajean

Description

@dugajean

I have just shifted from the old mongo extension to the newest PHP driver (mongodb). I'm also using the PHP library provided for mongodb.

Previously, I could simply do ->sort() on a cursor instance, but that doesn't seem to be the case anymore since I get this error:

Fatal error: Uncaught Error: Call to undefined method MongoDB\Driver\Cursor::sort()

What is the alternative to sorting/limiting/skipping now? Help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions