Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Perl and MongoDB find error

by Kanishka.black0 (Scribe)
on Apr 07, 2012 at 12:47 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://963916]
Approved by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 16:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found