Util.ExtractDoc Method

CSAL Mongo

Util ExtractDoc Method CSAL Mongo Access Library
Given a BSON document and a field, return the BSON document corresponding to src[fldName]. If that isn't possible (null values, incorrect type, etc) then do NOT throw an exception

Namespace: CSALMongo
Assembly: CSALMongo (in CSALMongo.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

public static BsonDocument ExtractDoc(
	BsonDocument src,
	string fldName
)
public static BsonDocument ExtractDoc(
	BsonDocument src,
	string fldName
)
Public Shared Function ExtractDoc ( 
	src As BsonDocument,
	fldName As String
) As BsonDocument
Public Shared Function ExtractDoc ( 
	src As BsonDocument,
	fldName As String
) As BsonDocument
public:
static BsonDocument^ ExtractDoc(
	BsonDocument^ src, 
	String^ fldName
)
public:
static BsonDocument^ ExtractDoc(
	BsonDocument^ src, 
	String^ fldName
)

Parameters

src
Type: BsonDocument
BSON doc to examine
fldName
Type: OnlineSystem String
Property to access in src

Return Value

Type: BsonDocument
src[fldName] as a BsonDocument. If src or fldName are null, then return null. If src[fldName] isn't a valid document, then return an empty/default BsonDocument instance.
See Also