stijnsanders / TMongoWire

Delphi MongoDB driver
MIT License
102 stars 37 forks source link

Every 36 character string gets turned into an ObjectId. #6

Closed smokingdev closed 12 years ago

smokingdev commented 12 years ago

Hi,

The BSONDoc code contained a bug which converted every 36 character string into an ObjectId.

I provided a patch which checks whether the string actually begins with 'ObjectId("' and ends with '")' instead of presuming it does.

Kind regards,

Fred Oranje

smokingdev commented 12 years ago

Hi,

Due to my unfamiliarity with Github Pull Request a second commit was added to this pullrequest, which I rather would have made into a separate one.

In my search for checking if the MongoDB connection is still alive I added the ping command which I found inside the Ruby driver documentation (http://api.mongodb.org/ruby/current/Mongo/Connection.html).

It is a command which returns even if the server is in lock. I chose to handle any exceptions TMongoWire throws inside the method, so it returns false in those cases.

Kind regards,

Fred Oranje

stijnsanders commented 12 years ago

Thank you. Please have a look at my recent commit, I've also replaced a few others. I don't check the suffix but as long as something is there, it's pretty irrelevant. Please post a new pull request for the Ping method.