eu acho que vc precisa utilizar o MongoDB::OID

Em 11 de janeiro de 2011 14:12, Daniel de Oliveira Mantovani <
[email protected]> escreveu:

> Pessoal, estou eu preciso fazer um find, usando o
> http://search.cpan.org/~kristina/MongoDB-0.40/lib/MongoDB.pm<http://search.cpan.org/%7Ekristina/MongoDB-0.40/lib/MongoDB.pm>
>
> O find é equivalente a esse código, usando o Mongo cliente.
>
>  db.Foo.find({_id : ObjectId("4d2935a35a25524b32190000")})
>
> Porém, fazendo isso usando o API em Perl, ele trata o "ObjectId" como
> uma string.
> find({_id => "ObjectID(4d2a0fae9e0a3b4b32f70000"})
>
> Que é o equivalente a fazer isso no Mongo Cliente.
>  db.Foo.find({_id : "ObjectId(4d2935a35a25524b32190000)"})
>
> A pergunta é, como fazer o equivalente a isso no Mongo cliente:
>
>  db.Foo.find({_id : ObjectId("4d2935a35a25524b32190000")})
>
> usando Perl.
>
>
> http://stackoverflow.com/questions/4659437/how-to-use-find-to-seach-id-objectidid-in-perl-api
>
> --
> "If you’ve never written anything thoughtful, then you’ve never had
> any difficult, important, or interesting thoughts. That’s the secret:
> people who don’t write, are people who don’t think."
> =begin disclaimer
>   Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>  SaoPaulo-pm mailing list: [email protected]
>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
> =end disclaimer
>



-- 
"o animal satisfeito dorme". - Guimarães Rosa
=begin disclaimer
   Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
 SaoPaulo-pm mailing list: [email protected]
 L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
=end disclaimer

Responder a