Skip to content

Instantly share code, notes, and snippets.

@tejasbubane
Created December 5, 2013 12:44
Show Gist options
  • Select an option

  • Save tejasbubane/7804584 to your computer and use it in GitHub Desktop.

Select an option

Save tejasbubane/7804584 to your computer and use it in GitHub Desktop.
Remove records corresponding to some dates. To be done if something goes wrong and process files again
db.snapshot_date_logs.remove({"_id.trans_date": ISODate("2013-12-04T05:00:00Z")})
db.snapshot_date_logs.remove({"_id.trans_date": ISODate("2013-12-05T05:00:00Z")})
db.date_logs.remove({"_id.trans_date": ISODate("2013-12-05T05:00:00Z")})
db.date_logs.remove({"_id.trans_date": ISODate("2013-12-04T05:00:00Z")})
user_details.remove("trans_date":{"$gte":Time.parse("2013-12-04")})
filenames.remove("_id"=>"/s3-rbi/log/rails_log_analytics/log_metrics_2013-12-04-00.log") ... upto 24 and next date if necessary
no need to change anything in items table since parser checks if open_id exists and only then inserts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment