MiniProject-Ping

command module
v0.0.0-...-c6e93ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2016 License: MIT Imports: 6 Imported by: 0

README

MiniProject-Ping

Import

I use MongoDB for data, please find some informations here

Import command:

mongoimport --drop --db test -c pings --type json --jsonArray pings.json

Convert date string into Date object (to be mongoDB compliant, not really useful in the project):

# May be run in the console or in a script.
function convert_date(date) {
    t = date.split(/[- :]/);
    return new Date(Date.UTC(t[0], t[1]-1, t[2], t[3], t[4], t[5]));
}

db.pings.find().forEach(function(ping){
    ping.created_at = convert_date(ping.created_at); 
    db.pings.save(ping);
})

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL