Table of Contents

Class BsonArray

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON array.

[Serializable]
public class BsonArray : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonArray>, IEquatable<BsonArray>, IList<BsonValue>, ICollection<BsonValue>, IEnumerable<BsonValue>, IEnumerable
Inheritance
BsonArray
Implements
Derived
Inherited Members
Extension Methods

Constructors

BsonArray()

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<BsonValue>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<ObjectId>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<bool>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<DateTime>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<double>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<int>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<long>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable<string>)

Initializes a new instance of the BsonArray class.

BsonArray(IEnumerable)

Initializes a new instance of the BsonArray class.

BsonArray(int)

Initializes a new instance of the BsonArray class.

Properties

BsonType

Gets the BsonType of this BsonValue.

Capacity

Gets or sets the total number of elements the internal data structure can hold without resizing.

Count

Gets the count of array elements.

IsReadOnly

Gets whether the array is read-only.

this[int]

Gets or sets a value by position.

RawValues

Gets the array elements as raw values (see BsonValue.RawValue).

Values

Gets the array elements.

Methods

Add(BsonValue)

Adds an element to the array.

AddRange(IEnumerable<BsonValue>)

Adds multiple elements to the array.

AddRange(IEnumerable<ObjectId>)

Adds multiple elements to the array.

AddRange(IEnumerable<bool>)

Adds multiple elements to the array.

AddRange(IEnumerable<DateTime>)

Adds multiple elements to the array.

AddRange(IEnumerable<double>)

Adds multiple elements to the array.

AddRange(IEnumerable<int>)

Adds multiple elements to the array.

AddRange(IEnumerable<long>)

Adds multiple elements to the array.

AddRange(IEnumerable<string>)

Adds multiple elements to the array.

AddRange(IEnumerable)

Adds multiple elements to the array.

Clear()

Clears the array.

Clone()

Creates a shallow clone of the array (see also DeepClone).

CompareTo(BsonArray)

Compares the array to another array.

CompareTo(BsonValue)

Compares the array to another BsonValue.

Contains(BsonValue)

Tests whether the array contains a value.

CopyTo(BsonValue[], int)

Copies elements from this array to another array.

CopyTo(object[], int)

Copies elements from this array to another array as raw values (see BsonValue.RawValue).

Create(object)

Creates a new BsonArray.

DeepClone()

Creates a deep clone of the array (see also Clone).

Equals(BsonArray)

Compares this array to another array.

Equals(object)

Compares this BsonArray to another object.

GetEnumerator()

Gets an enumerator that can enumerate the elements of the array.

GetHashCode()

Gets the hash code.

IndexOf(BsonValue)

Gets the index of a value in the array.

IndexOf(BsonValue, int)

Gets the index of a value in the array.

IndexOf(BsonValue, int, int)

Gets the index of a value in the array.

Insert(int, BsonValue)

Inserts a new value into the array.

Remove(BsonValue)

Removes the first occurrence of a value from the array.

RemoveAt(int)

Removes an element from the array.

ToArray()

Converts the BsonArray to an array of BsonValues.

ToList()

Converts the BsonArray to a list of BsonValues.

ToString()

Returns a string representation of the array.

Operators

operator ==(BsonArray, BsonArray)

Compares two BsonArray values.

operator !=(BsonArray, BsonArray)

Compares two BsonArray values.