Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MongoDB CPAN distribution.

Maintainer(s)' notes

Please don't report bugs here. Please use the MongoDB Perl driver issue tracker instead.

Report information
The Basics
Id: 67884
Status: resolved
Priority: 0/
Queue: MongoDB

People
Owner: Nobody in particular
Requestors: jettero [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: find_and_modify there and not there (??)
Why is there no find_and_modify (that I can find anyway) in the MongoDB driver for perl? I'm thinking of pasting this in: http://goo.gl/nuB6s But it seems like something that should be pasted into the actual driver. Curiously, it seems it *was* in there at one time, but it got stripped out by k@ubuntu.(none) ?? https://github.com/mongodb/mongo-perl-driver/commit/1096d84#L3L698 Is there some reason it was removed? -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
I went ahead and restored it on my github fork (branch name should make it obvious on the network view); but I did not issue a pull request since I have no idea why it was removed. I do suspect a mistake. -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
I'm beginning to wonder if it was removed because of various strange problems. The one I'm getting now is here: https://github.com/mongodb/mongo/blob/master/db/update.cpp#L601 I'm quite sure (through various debug warnings) that find_and_modify is passing a $pop to perl_mongo_sv_to_bson; although, I'm not 100%. My thinking is that the op is getting thrown out somewhere before ModSetState::applyModsInPlace gets called. Who knows. I'm going to explore the mongodb issue tracker later today. -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
The problem with having helpers like findAndModify is that the command keeps changing and getting new options, so keeping it backwards and forwards compatible with different db versions is annoying. You can use the run_command function to run findAndModify yourself.
I've added an example in the docs of how to use it from Perl.