Q:

node.js cannot read json from mongoexport

I've exported a collection from mongo using the following command:
mongoexport -d <database-name> -c <collection-name> -o foo.json

Export worked fine and produced foo.json which looked like this:
{
  "_id" : { "$oid" : "76safuysadf76tsaydgf" },
  "name" : "John",
  "number" : 3
}
{
  "_id" : { "$oid" : "dfsafuysaasdf7tsayd6" },
  "name" : "Fred",
  "number" : 4
}
{
  "_id" : { "$oid" : "876sfuyg7rfasff4ffff" },
  "name" : "Paul",
  "number" : 1
}

Now I want to read this json file with node.js, edit the data and save back to the file (or a new file).  For example I want to remove the number field from each user.  
I'm having trouble reading the file with node.  I tried this:
var fs = require("fs");
var obj = JSON.parse(fs.readFileSync("./foo.json"));
console.log(obj);

But I get the following error:
uncaughtException: Unexpected token {
SyntaxError: Unexpected token {

A:

EDIT:
From the mongoexport docs: http://docs.mongodb.org/manual/reference/program/mongoexport/
Use the --jsonArray option to get output in a JSON array, as I described in my original answer. 
Original Answer
It looks like you are trying to parse a JSON array, instead of one object.  Try adding [] and commas to the output from mongoexport so it looks like this:
[{
   "_id" : { "$oid" : "76safuysadf76tsaydgf" },
   "name" : "John",
   "number" : 3
},
{
   "_id" : { "$oid" : "dfsafuysaasdf7tsayd6" },
   "name" : "Fred",
   "number" : 4
},
{
   "_id" : { "$oid" : "876sfuyg7rfasff4ffff" },
   "name" : "Paul",
   "number" : 1
}]

