Description
It would be nice to have TryParse support for BsonDocument instead of just the Parse method which throws an exception.
For example, the current way to parse a string:
BsonDocument document = BsonDocument.Parse("{}");
|
If this fails it throws an exception. However most of the .NET framework now supports a less heavy check, for example:
BsonDocument document;
|
|
|
if (!document.TryParse("{}",out document))
|
{
|
// Handle failed parse
|
}
|