Importing JSON-ified HTTP Response Headers Through a .txt File into a Mongo Database

The format of a JSON-ified HTTP response header is below:

{
  "url": "aalfs.com",
  "statusCode": 301,
  "headers": {
    "date": "Tue, 12 Mar 2013 19:36:28 GMT",
    "server": "Strategi HTTPD V2R5M1",
    "connection": "Keep-Alive",
    "content-length": "0",
    "location": "/index.htm"
  }
}

Using MongoJS, I have programmed Mongo to interpret the data as such, with three main variables - url, statusCode, headers:

function site(url, statusCode, headers){
    this.url = url;
    this.statusCode = statusCode;
    this.headers = headers;
}

With url as the __id:

db.scrape.ensureIndex({url:1},{unique:true});

In my code, I can import HTTP response headers into my database via this object:

var site1 = new site("www.thing.com", "300", {"header information"});

db.scrape.save(site1, function(err, savedUser){
    if(err||!savedUser) console.log("URL " + site.url + " not saved because of error " + err);
    else console.log("URL " + savedUser.url +" saved");
});

My question is - I am looking for a more convenient/efficient way to important hundreds of HTTP response headers into my Mongo database. I have hundreds of those JSON-ified HTTP response headers in the format that is demonstrated above, saved in a .txt file. Is it possible for Mongo to simply read my .txt file and interpret and import into Mongo?

You can use mongoimport. Look at the various options here

You will have to replace 'url' literal with '_id'