Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Perl and MongoDB find error

by Kanishka.black0 (Beadle)
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

Comment on Perl and MongoDB find error
Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-10-24 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls