c# - Check if an array exists in a BsonValue type -
i have bsonvalue abc
, looking way check if contains array or not. structure below:
"abc":[ "key1": "value1", "key2": "value2", . . "mno":{ "pqr":[ "valuefirst", "valuesecond" ] }, . . ]
in c# code when try check if array pqr exists if(abc["mno"]["pqr"] != null)
, keynotfoundexception. wrong on part index abc
pqr
or mno
when doesn't exist. so, how can abc
stored bsonvalue checked existence of these , overcome exception? thought of using filter
. works bsondocument
(please correct me if wrong). work around this?
Comments
Post a Comment