[CSHARP-594] BsonTypeMapper.TryMapToBsonValue fails when passed a QueryDocument Created: 09/Oct/12  Updated: 20/Mar/14  Resolved: 09/Oct/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.6
Fix Version/s: 1.6.1

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

To reproduce:

var query = new QueryDocument("x", 1);
BsonValue bsonValue;
var ok = BsonTypeMapper.TryMapToBsonValue(query, out bsonValue);

TryMapToBsonValue knows about the BsonDocument object model, but not about the classes derived from BsonDocument (like QueryDocument).

There is a pull request from Oleg Kosmakov with a fix for this:

https://github.com/mongodb/mongo-csharp-driver/pull/133



 Comments   
Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T14:50:36-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-594: Fixed cherry-picking failure to add new file in the right directory (2.0 renaming of directories confused it).
Branch: x2.0
https://github.com/mongodb/mongo-csharp-driver/commit/7cc7849c4f844071df4e74dcd7f034aa745985f2

Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T06:54:26-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-594: Fixed similar issue in MapToBsonValue and added unit tests.
Branch: x2.0
https://github.com/mongodb/mongo-csharp-driver/commit/d58dcbc68443a03b2f6f0f9d662a0eeefe20e4cf

Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T06:54:26-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-594: Fixed similar issue in MapToBsonValue and added unit tests.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/40e69fe1cf45b0ed9d68a551b0222a140fa26ba2

Generated at Wed Feb 07 21:37:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.