Util.ExtractArray Method

CSAL Mongo

Util ExtractArray Method CSAL Mongo Access Library
Given a BSON document and a field, return the BSON array 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 BsonArray ExtractArray(
	BsonDocument src,
	string fldName
)
public static BsonArray ExtractArray(
	BsonDocument src,
	string fldName
)
Public Shared Function ExtractArray ( 
	src As BsonDocument,
	fldName As String
) As BsonArray
Public Shared Function ExtractArray ( 
	src As BsonDocument,
	fldName As String
) As BsonArray
public:
static BsonArray^ ExtractArray(
	BsonDocument^ src, 
	String^ fldName
)
public:
static BsonArray^ ExtractArray(
	BsonDocument^ src, 
	String^ fldName
)

Parameters

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

Return Value

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