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
Deleting Data That Has Been Processed
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Toby Ho  
View profile  
 More options Oct 4 2012, 9:22 am
From: Toby Ho <airpor...@gmail.com>
Date: Thu, 4 Oct 2012 06:22:37 -0700 (PDT)
Local: Thurs, Oct 4 2012 9:22 am
Subject: Deleting Data That Has Been Processed

Hello all,

I am writing a batch job to aggregate some data using the aggregation
framework. Since the data output is potentially larger than the document
limit size, I am using a $limit in the top of my pipeline to reduce the
number of objects that are processed at a time. After the aggregation is
complete, I save off the result in another collection. Now, I would like to
remove all the records I have processed so far. how would I reliably do
this without having to worry about race conditions? Or is there a better
way to go about what I am trying to do?

Thanks,
Toby


 
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.
Stephen Steneker  
View profile  
 More options Oct 7 2012, 7:58 pm
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Sun, 7 Oct 2012 16:58:04 -0700 (PDT)
Local: Sun, Oct 7 2012 7:58 pm
Subject: Re: Deleting Data That Has Been Processed

> I am writing a batch job to aggregate some data using the aggregation
> framework. Since the data output is potentially larger than the document
> limit size, I am using a $limit in the top of my pipeline to reduce the
> number of objects that are processed at a time. After the aggregation is
> complete, I save off the result in another collection. Now, I would like to
> remove all the records I have processed so far. how would I reliably do
> this without having to worry about race conditions? Or is there a better
> way to go about what I am trying to do?

Hi Toby,

This question has also been discussed on StackOverflow:

http://stackoverflow.com/questions/12716599/mongodb-batch-jobs-and-de...

As suggested in the comments there, the expected approach would be to use
a deterministic boundary such as date or id values to filter rather than
relying on $limit.

Cheers,
Stephen


 
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.
viC  
View profile  
 More options Oct 8 2012, 6:54 am
From: viC <vicky.it....@gmail.com>
Date: Mon, 8 Oct 2012 03:54:34 -0700 (PDT)
Local: Mon, Oct 8 2012 6:54 am
Subject: Re: Deleting Data That Has Been Processed

In case you don't have a criteria to separate them, try this:

    1> rename your collection

    2> Now do all your processing on the new collection.

*Warning: It doesn't work well in Sharded environments*


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »