Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Issue using $all

Received: by 10.180.19.71 with SMTP id c7mr1599993wie.0.1337055698339;
        Mon, 14 May 2012 21:21:38 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.216.214.136 with SMTP id c8ls9974191wep.8.gmail; Mon, 14 May
 2012 21:21:14 -0700 (PDT)
Received: by 10.180.8.137 with SMTP id r9mr267122wia.2.1337055674178;
        Mon, 14 May 2012 21:21:14 -0700 (PDT)
Received: by 10.180.8.137 with SMTP id r9mr267121wia.2.1337055674169;
        Mon, 14 May 2012 21:21:14 -0700 (PDT)
Return-Path: <andr...@andreas-jung.com>
Received: from smtprelay06.ispgateway.de (smtprelay06.ispgateway.de. [80.67.31.102])
        by gmr-mx.google.com with ESMTP id er1si6494456wib.0.2012.05.14.21.21.14;
        Mon, 14 May 2012 21:21:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of andr...@andreas-jung.com designates 80.67.31.102 as permitted sender) client-ip=80.67.31.102;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of andr...@andreas-jung.com designates 80.67.31.102 as permitted sender) smtp.mail=andr...@andreas-jung.com
Received: from [93.206.45.66] (helo=sucmac.local)
	by smtprelay06.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.68)
	(envelope-from <andr...@andreas-jung.com>)
	id 1SU9G5-0007ax-Og
	for mongodb-user@googlegroups.com; Tue, 15 May 2012 06:21:13 +0200
Message-ID: <4FB1D9B9.4060408@andreas-jung.com>
Date: Tue, 15 May 2012 06:21:13 +0200
From: Andreas Jung <andr...@andreas-jung.com>
Reply-To: andr...@andreas-jung.com
User-Agent: Postbox 3.0.3 (Macintosh/20120304)
MIME-Version: 1.0
To: mongodb-user@googlegroups.com
Subject: Re: [mongodb-user] Issue using $all
References: <CALMJ_ASwJD22WS5Vg4q_-pCzPA0hpsTZCz+mDin5Hq3shk9wSw@mail.gmail.com>
In-Reply-To: <CALMJ_ASwJD22WS5Vg4q_-pCzPA0hpsTZCz+mDin5Hq3shk9wSw@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Df-Sender: aW5mb0B6b3B5eC5uZXQ=

MongoDB version?

Working as it should with 2.0.4

> db.foo.findOne({data:{$all:['first','second']}})
{
	"_id" : ObjectId("4fb1d97efaecad328c6964d8"),
	"data" : [
		"first",
		"comment",
		"second",
		"comment"
	]
}
> db.foo.findOne({data:{$all:['first','second', 'comment']}})
{
	"_id" : ObjectId("4fb1d97efaecad328c6964d8"),
	"data" : [
		"first",
		"comment",
		"second",
		"comment"
	]
}
>

-aj

Tim Rieder wrote:
> I have an array of strings that I want to search (I'm interested in
> finding this particular entry):
> 
>> db.FTS.findOne({"_id":ObjectId("4fb1c5bdd160d1c77dc594a3")})
> {
>         "_id" : ObjectId("4fb1c5bdd160d1c77dc594a3"),
>         "data" : [
>                 "first",
>                 "comment",
>                 "second",
>                 "comment"
>         ]
> }
> 
> So I do a search and get a result:
> 
>> db.FTS.findOne({data:{$all:['first','second']}})
> {
>         "_id" : ObjectId("4fb1c5bdd160d1c77dc594a3"),
>         "data" : [
>                 "first",
>                 "comment",
>                 "second",
>                 "comment"
>         ]
> }
> 
> Now I want to add the word comment:
> 
>> db.FTS.findOne({data:{$all:['first','second','comment']}})
> null
> 
> Why is this null?
> 
> Thanks!
> 

-- 
ZOPYX Limited         | Python | Zope | Plone | MongoDB
Charlottenstr. 37/1   | Consulting & Development
D-72070 T�bingen      | Electronic Publishing Solutions
www.zopyx.com         | Scalable Web Solutions
--------------------------------------------------
Produce & Publish - www.produce-and-publish.com