Skip to content

Instantly share code, notes, and snippets.

@Climax777
Created June 5, 2020 08:13
Show Gist options
  • Select an option

  • Save Climax777/ce6bb64db9fcd6cdb23293022d33fe68 to your computer and use it in GitHub Desktop.

Select an option

Save Climax777/ce6bb64db9fcd6cdb23293022d33fe68 to your computer and use it in GitHub Desktop.

Revisions

  1. Climax777 created this gist Jun 5, 2020.
    2 changes: 2 additions & 0 deletions timestampfixer.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    b = []; a = 0; db.snapshots.find({camera: {$in: ["5dfb35f7bd040908dd2bed04", "5df9e2cfbd040908dd2bec92"]}}, {timestamp:1}).sort({_id: 1}).forEach(function(item) {if(-(item._id.getTimestamp()) + item.timestamp > 5*60*1000) {print('WHAAAT: ' + Math.abs(+(item._id.getTimestamp()) - item.timestamp)/1000/60 + ' ' + +(item._id.getTimestamp()) + ' ' + item.timestamp + item._id.getTimestamp()); a++; b.push(item);}})
    b.forEach(function(snap){printjson(snap); db.snapshots.updateOne({_id: snap._id},{$set: {timestamp: +(snap._id.getTimestamp())}})})