Skip to content

Instantly share code, notes, and snippets.

View Harryman's full-sized avatar

Harrison Stahl Harryman

  • The Everything Corp
  • Global
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@Harryman
Harryman / ISOstring->ISODate Mongo
Created March 21, 2015 18:06
ISO String to ISODate Object MongoDB
db.txs.find({
ts:{$ne:"",$type:2}//selects only ts(timestamps) that are not empty and are strings
},{
ts:1 //returns only the string and _id
}).forEach(function(ob){//iterates
var out = new Date(ob.ts);
db.txs.update({_id:ob._id},{$set:{"ts":out}});
});