I'm trying to convert a string into a BsonDocument with Parse() method, but I keep getting the error "Cannot deserialize a 'BsonDocument' from BsonType 'String'.". My string is in the following format: string str = {'name': 'John', 'surname':'McLure'}
and I call the method this way BsonDocument document = BsonDoucment.Parse(str)
.
I saw Convert string into MongoDB BsonDocument and it says to use Parse method to convert a string into a BsonDocument, but it isn't working!
Thanks in advance