Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Perl and MongoDB find error

by Kanishka.black0 (Scribe)
on Apr 07, 2012 at 12:47 UTC ( #963916=perlquestion: print w/replies, xml ) Need Help??
Kanishka.black0 has asked for the wisdom of the Perl Monks concerning the following question:

my $list = $userinfo->userinfo->find({ user => $uid },{ user => 1});
i tried to grab data from the mongodb, this should get only the user object from the collection
but it is getting even other items from the object

Replies are listed 'Best First'.
Re: Perl and MongoDB find error
by Anonymous Monk on Apr 08, 2012 at 03:58 UTC

    this should get only the user object from the collection

    Why? You specify two users ... Maybe you'd like to use find_one?

      it seems that mongodb "find" doesn't support query for fields, i though its would support them as in "find_one"

        it seems that mongodb "find" doesn't support query for fields, i though its would support them as in "find_one"

        It doesn't seem that way to me. See MongoDB::Examples

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://963916]
Approved by toolic
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2016-12-10 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (164 votes). Check out past polls.