[SP-pm] Tratar funções como funções MongoDB

Solli Honorio shonorio at gmail.com
Tue Jan 11 09:35:53 PST 2011


eu acho que vc precisa utilizar o MongoDB::OID

Em 11 de janeiro de 2011 14:12, Daniel de Oliveira Mantovani <
daniel.oliveira.mantovani em gmail.com> 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: SaoPaulo-pm em pm.org
>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
> =end disclaimer
>



-- 
"o animal satisfeito dorme". - Guimarães Rosa
-------------- Pr?xima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20110111/d442f29e/attachment.html>


More information about the SaoPaulo-pm mailing list