Skip to content

Doctrine\MongoDB\Query\Expr::popFirst is incorrect #1830

Closed
@juliusxyg

Description

@juliusxyg

Bug Report

Q A
BC Break no
Version 1.6.2

Summary

Two methods
Doctrine\MongoDB\Query\Expr::popFirst()
Doctrine\MongoDB\Query\Expr::popLast()

use wrong $pop value.

Current behavior

according to mongodb manual

The $pop operator removes the first or last element of an array. Pass $pop a value of -1 to remove the first element of an array and 1 to remove the last element in an array.

pop first is -1, pop last is 1,

in the code is just reversed.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions