How do I access inner(embedded) Document's properties in C#

14 views
Skip to first unread message

sdh...@rapidbizapps.com

unread,
Jun 22, 2015, 12:04:40 PM6/22/15
to mobile-c...@googlegroups.com
I have a document that contains a embedded document . 

Lets say document has following structure 
{ username: "john", name: "John Crouch", address: { "city": "Fortworth", "state": "Texas", "country": "United States" }, phone: "3594584" }


Document.Properties gives me A Dictionary<string , objects> so to access address inner properties I have do a typecast of Document.Properties["address"] . but I tried casting this as IDictionary<string , object > and Document which throws a typeCast exception .


However in Java I am able to cast inner document as (Map<String ,Object>)document.get("address")) .

Jim Borden

unread,
Jun 25, 2015, 5:28:21 PM6/25/15
to mobile-c...@googlegroups.com
Are you casting to `IDictionary` or just `Dictionary` because those will have different results.  Can you examine to see what type it actually is?
Reply all
Reply to author
Forward
0 new messages