Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^6: Perl and MongoDB find error

by Kanishka.black0 (Scribe)
on May 22, 2012 at 16:35 UTC ( #971827=note: print w/replies, xml ) Need Help??

in reply to Re^5: Perl and MongoDB find error
in thread Perl and MongoDB find error

find is not working i check the code, it been redirected to query in for final processing , even i was unable to digest at first.

Replies are listed 'Best First'.
Re^7: Perl and MongoDB find error
by MyMonkName (Acolyte) on Nov 06, 2012 at 23:33 UTC

    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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971827]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2018-01-18 02:16 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (206 votes). Check out past polls.