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 Atomic update to embedded array item
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Dirolf  
View profile  
 More options Sep 24 2010, 9:50 am
From: Michael Dirolf <m...@10gen.com>
Date: Fri, 24 Sep 2010 09:50:04 -0400
Local: Fri, Sep 24 2010 9:50 am
Subject: Re: [mongodb-user] Re: Atomic update to embedded array item
Yes. Add something to the query document to select the post you want to update.
On Fri, Sep 24, 2010 at 09:48, Ash <sse...@googlemail.com> wrote:
> thanks,

> can i do that particular update that will only affect a specific post?

> On Sep 24, 2:44 pm, Michael Dirolf <m...@10gen.com> wrote:
>> Use the positional ($) modifier. So something like:
>> update({"comments.id": 2}, {$set: {"comments.$.name": "foo"}})

>> On Fri, Sep 24, 2010 at 09:07, Ash <sse...@googlemail.com> wrote:
>> > How can update an embedded array item using atomic update

>> > e.g. posts -> comments

>> > i would like to update a comment which has id of 2 by change the
>> > comment name

>> > --
>> > You received this message because you are subscribed to the Google Groups "mongodb-user" group.
>> > To post to this group, send email to mongodb-user@googlegroups.com.
>> > To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
>> > For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


 
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.