oliwer / mango

Pure-Perl non-blocking I/O MongoDB driver
https://metacpan.org/release/Mango
Artistic License 2.0
27 stars 12 forks source link

Mango::Collection::insert modifies the parameters #11

Closed JianleiZhang closed 8 years ago

JianleiZhang commented 8 years ago

From package Mango::Collection: sub insert { ...

Make sure all documents have ids

my @ids = map { $_->{_id} //= bson_oid } @$docs; ... }

The variable transmission has been modified When I re-use this variable

oliwer commented 8 years ago

You're right. I wonder why it was written like that. I guess it can be seen as a feature?

Anyway, I will write a patch for this soon.

oliwer commented 8 years ago

Sorry for the delay, and thanks for the report!