Skip to content

findAll / findBy cursor option #805

Closed
@sb8244

Description

@sb8244

I would like to propose a change to #752 regarding the cursor. I feel like there should be a configuration option to disable dumping the cursor iterator and do it as it was done before. The reasoning is that for larger data sets, many times one would not want to tie up the entire db throughput in 1 go. Also, dumping the iterator makes it much easier to run into memory issues from passing cursors around. I understand the reasoning behind the change, but feel that the BC removes a huge flexibility of using Mongo ODM.

The findAll() and findBy() methods in DocumentRepository previously returned a Cursor object, which was not compatible with the ObjectRepository interface in Doctrine Common. This has been changed in #752, so these methods now return a numerically indexed array. The change also affects the magic repository methods, which utilize findBy() internally. If users require a Cursor, they should utilize the query builder or a custom repository method.

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