Claro, pero lo que necesito en sacar el resultado como con el "find()" o algo 
similar del PyMongo.Mas allá de extraer toda la colección y luego trabajarla.
Saludos;César Céspedes Loayza

> CC: python-es@python.org
> From: jcaballero....@gmail.com
> Date: Sun, 22 Apr 2012 10:36:33 -0400
> To: python-es@python.org
> Subject: Re: [Python-es] Pymongo
> 
> 
> 
> 
> 
> On Apr 22, 2012, at 9:48, Cesar Cespedes Loayza <cche...@hotmail.com> wrote:
> 
> > Buenos días a todos, tengo un pequeño inconveniente, tengo un colección con 
> > muestro, y deseo crear una consulta que me muestre los datos como en el 
> > resultado.
> > Intente de muchas formas formas, hasta con map-reduce pero no encuentro la 
> > solución.
> > 
> > 
> > Colección
> > {
> >     “_id”    : “4da2c0e2e999fb56bf000002”,
> >     “nompap” : “papa1”,
> >     “hijos”  : [
> >                 {
> >                  “_id”    : “4da2c0e2e999fb56bf000003”, 
> >                  “nomhij” : "hijo1",
> >                 },
> >                 {
> >                  “_id”    : “4da2c0e2e999fb56bf000004”, 
> >                  “nomhij” : "hijo2",
> >                 },
> >                 {
> >                  “_id”    : “4da2c0e2e999fb56bf000005”, 
> >                  “nomhij” : "hijo3",
> >                 }                      
> >                ]
> > }
> > {
> >     “_id”    : “4da2c0e2e999fb56bf000006”,
> >     “nompap” : “papa2”,
> >     “hijos”  : [
> >                 {
> >                  “_id”    : “4da2c0e2e999fb56bf000007”, 
> >                  “nomhij” : "hijo21",
> >                 },
> >                 {
> >                  “_id”    : “4da2c0e2e999fb56bf000008”, 
> >                  “nomhij” : "hijo22",
> >                 }                     
> >                ]
> > }
> > 
> > 
> > Resultado
> > {“nompap” : “papa1”,“nomhij” : "hijo1"}
> > {“nompap” : “papa1”,“nomhij” : "hijo2"}
> > {“nompap” : “papa1”,“nomhij” : "hijo3"}
> > {“nompap” : “papa2”,“nomhij” : "hijo21"}
> > {“nompap” : “papa2”,“nomhij” : "hijo22"}
> > 
> > 
> > Saludos;
> > César Céspedes Loayza
> > ________________________________
> 
> 
> Parece algo que con un doble loop se debería sacar sin problema.
> ¿no estarás teniendo problemas por el hecho de que hijos es una lista en 
> lugar de un dict?
> 
> Jose
> _______________________________________________
> Python-es mailing list
> Python-es@python.org
> http://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
                                          
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a