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 clean orhpan GriFS elements.

Date: Tue, 25 Sep 2012 08:11:13 -0700 (PDT)
From: "A. Jesse Jiryu Davis" <je...@10gen.com>
To: mongodb-user@googlegroups.com
Message-Id: <208f319b-6b0e-4394-b70b-8962d02b7ea8@googlegroups.com>
In-Reply-To: <e9d5c05a-e7b9-4cbd-962a-39c59f877de8@r7g2000yqa.googlegroups.com>
References: <8ad9b33d-3a43-4585-88a8-2173c51c1d87@i14g2000yqo.googlegroups.com>
 <CAFqwGEyMsg2H6jyc3HbTL7RAZyS9VH8R+7mddrdL+yfsw3hcVw@mail.gmail.com>
 <07b1ab07-5cb3-4007-abf7-fe9853378e5f@e18g2000yqo.googlegroups.com>
 <fbe58587-e567-4585-ad26-2ac1524f1628@r10g2000vby.googlegroups.com>
 <CAFqwGEySGthmq3yEtODN8jVCGGQ3oZKLuQP0gpN4tXmux4+7Wg@mail.gmail.com>
 <58216787-e681-43c9-970c-b347f7f3fd51@k6g2000vbr.googlegroups.com> <e77d7373-50d3-4daa-a5f0-1fc087cfe27c@k20g2000vbj.googlegroups.com>
 <e9d5c05a-e7b9-4cbd-962a-39c59f877de8@r7g2000yqa.googlegroups.com>
Subject: Re: clean orhpan GriFS elements.
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2556_6699713.1348585873349"

------=_Part_2556_6699713.1348585873349
Content-Type: multipart/alternative; 
	boundary="----=_Part_2557_26971001.1348585873349"

------=_Part_2557_26971001.1348585873349
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

No, it's not a MongoDB bug. It seems that you have successfully deleted a 
file from GridFS, but you haven't deleted the file's id from users and 
hence whenever your template tries to do a "get" on that file it gets 
the  "no file in gridfs collection" error. I don't think this line is doing 
what you want it to:

self.db.users.update({"produit_up.spec.id":produ}, {"$pull":{"produit_up"{"
spec.id":produ}}})

It has a syntax error, you need another ":". Once you've fixed that, verify 
that the "$pull" is really removing the *reference* to the GridFS file from 
the users collection. If you delete the file from GridFS, but you don't 
delete its id from "users", then you'll continue to try to get the file 
whenever you render your template, and that causes the error.

On Tuesday, September 25, 2012 7:18:48 AM UTC-4, aliane abdelouahab wrote:
>
> any ideas? is it a mongodb bug? (dont flush the GridFS?) 
>
> On 24 sep, 22:11, aliane abdelouahab <alabdeloua...@gmail.com> wrote: 
> > still dont get the error! any help? 
>

------=_Part_2557_26971001.1348585873349
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

No, it's not a MongoDB bug. It seems that you have successfully deleted a f=
ile from GridFS, but you haven't deleted the file's id from users and hence=
 whenever your template tries to do a "get" on that file it gets the&nbsp;&=
nbsp;"no file in gridfs collection" error. I don't think this line is doing=
 what you want it to:<div><br></div><div>self.db.users.update({"<a href=3D"=
http://produit_up.spec.id/" target=3D"_blank" style=3D"cursor: pointer; ">p=
roduit<wbr>_up.spec.id</a>":produ},&nbsp;{"$pull":{"produit_up"{"<a href=3D=
"http://spec.id/" target=3D"_blank" style=3D"cursor: pointer; ">spec.<wbr>i=
d</a>":produ}}})<br><div><div><br></div><div>It has a syntax error, you nee=
d another ":". Once you've fixed that, verify that the "$pull" is really re=
moving the <b>reference</b>&nbsp;to the GridFS file from the users collecti=
on. If you delete the file from GridFS, but you don't delete its id from "u=
sers", then you'll continue to try to get the file whenever you render your=
 template, and that causes the error.</div><br>On Tuesday, September 25, 20=
12 7:18:48 AM UTC-4, aliane abdelouahab wrote:<blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padd=
ing-left: 1ex;">any ideas? is it a mongodb bug? (dont flush the GridFS?)
<br>
<br>On 24 sep, 22:11, aliane abdelouahab &lt;<a>alabdeloua...@gmail.com</a>=
&gt; wrote:
<br>&gt; still dont get the error! any help?
<br></blockquote></div></div>
------=_Part_2557_26971001.1348585873349--

------=_Part_2556_6699713.1348585873349--