From: Asya Kamsky <a...@10gen.com>
Date: Tue, 2 Oct 2012 05:56:27 -0700 (PDT)
Local: Tues, Oct 2 2012 8:56 am
Subject: Re: pymongo: issues using $lte and $gte
I'm sorry I was responding to part of the last message and not the whole The point I was trying to make was to make a distinction between $elemMatch $elemMatch in the query document is used to match an element of an array Asya
Le mardi 2 octobre 2012 08:40:37 UTC-4, aliane abdelouahab a écrit :
> amsorry, but dont get the idea? > On 2 oct, 13:33, Asya Kamsky <a...@10gen.com> wrote: > > You need to use $elemMatch in the query part (the first JSON document > > list(db.users.find({"produit_up":{"$elemMatch" : {"$gte": 0, "$lte": > > You probably don't need to use it in the projection part (second JSON > > Asya > > Le mardi 2 octobre 2012 05:39:39 UTC-4, aliane abdelouahab a écrit : > > > the result in only one element? am i doing something wrong? it seems > > > it returns only one element! > > > list(db.users.find({"produit_up.spec.prix": {"$gte": 0, "$lte": > > > Out[16]: > > > db.users.find({"produit_up.spec.prix": {"$gte": 0, "$lte": > > > how do i get the value 3 ? > > > On 2 oct, 06:36, Bernie Hackett <ber...@10gen.com> wrote: > > > > >>> pprint(list(db.users.find({"produit_up.spec.prix": {"$gte": 0, > > > > [{u'produit_up': [{u'avatar': {u'avctype': u'image/jpeg', > > > > This also requires MongoDB 2.2.x. It will not work in earlier > > > > On Mon, Oct 1, 2012 at 11:02 AM, aliane abdelouahab > > > > <alabdeloua...@gmail.com> wrote: > > > > > list(db.users.find({"produit_up.spec.prix":{" > > > > > and it returns error! > > > > > how do i use it? > > > > > On 1 oct, 16:42, Bernie Hackett <ber...@10gen.com> wrote: > > > > >> To get the behavior I think you're asking for see the $elemMatch > > > > >>http://docs.mongodb.org/manual/reference/projection/elemMatch/ > > > > >> On Mon, Oct 1, 2012 at 6:21 AM, aliane abdelouahab > > > > >> <alabdeloua...@gmail.com> wrote: > > > > >> > -- > > > > >> > To unsubscribe from this group, send email to > > > > > -- > > > > > To unsubscribe from this group, send email to You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||