Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^7: Perl and MongoDB find errorby MyMonkName (Acolyte) |
on Nov 06, 2012 at 23:33 UTC ( [id://1002604]=note: print w/replies, xml ) | Need Help?? |
If you look at the tests in the distribution, they don't even test ``find'' with supplied key/value pairs, per what OP wants to do. For example: my $some_users = $users->find({"name" => "Joe"}); If you try this, you'll get undefined values as you iterate over the cursor. (example taken straight from the documentation of MongoDB::Tutorial) OTOH, if you try this: my $john = $users->find({"name" => qr/joh?n/i}); It seems to work. (Also from the documentation.) How bizarre.
In Section
Seekers of Perl Wisdom
|
|