Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
NodeReaper listens to Dies Irae

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-07-20 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (441 votes). Check out past polls.

    Notices?