Re: [mongodb-csharp] Querying dynamic types

18 views
Skip to first unread message

Robert Stam

unread,
Sep 4, 2012, 10:26:24 PM9/4/12
to mongodb...@googlegroups.com
The current version of the C# driver (1.6) does not yet support C# dynamic types.

Support for C# dynamic types has not yet been scheduled, so I don't know when it will be added. You can follow the JIRA ticket:

https://jira.mongodb.org/browse/CSHARP-539

On Tue, Sep 4, 2012 at 6:21 PM, SID <sidhart...@gmail.com> wrote:
I have  Json data whose full structure I don't know. I want to store this data in MongoDb using c# driver.
I couldn't use c# dynamic keyword as this is not supported by c# driver Deserializer.

I worked around this by creating Bson documents based on json passed. 

var bsonDocument = BsonSerializer.Deserialize<BsonDocument>(json);
testcollection.Insert(bsonDocument,SafeMode.True);

I want to use linq to query such documents without using a type so that I can get back a list of BsonDocuments matching a criteria.
Is there a way I can do it.

Regards,
Sidharth 



Reply all
Reply to author
Forward
0 new messages