I'd like for mongo to generate it's _ids as strings. They're much more useable when sending back and fourth to the client or using in other parts of the program. Right now I convert them to strings for all this stuff and then convert them back to run queries.
Any ideas or reasons not to?
You can set the _id however you want. You could even create an ObjectId, convert it to a string, and then save the string instead of the actual ObjectId. The main thing you would lose here is compactness. A minor thing you would lose is the ability to extract values out of the ObjectId without casting it, like the date, etc.
An example:
> var newId = new ObjectId();
> db.test.insert({_id:newId, x:"test"});
> db.test.find();
{ "_id" : ObjectId("4f94c2a11a6bbec3872cb315"), "x" : "test" }
> db.test.insert({_id:newId.str, x:"test"});
> db.test.find();
{ "_id" : ObjectId("4f94c2a11a6bbec3872cb315"), "x" : "test" }
{ "_id" : "4f94c2a11a6bbec3872cb315", "x" : "test" }
Update: You would have to recast it to an ObjectId to do this:
> var newId = new ObjectId();
> newId.getTimestamp();
ISODate("2012-04-23T03:22:56Z")