dotConnect for MongoDB Documentation
Devart.Data.MongoDB Namespace / MongoDBField Class
Properties Methods


On this page
    MongoDBField Class Members
    On this page

    The following tables list the members exposed by MongoDBField.

    Public Properties
     NameDescription
    Public PropertyGets the dot-separated path of the field built from the names stored in the document.  
    Public PropertyReturns this field, marked to be written as an array; use it to access items by index or to assign a .NET array to Value.  
    Public PropertyReturns this field, marked to be written as binary data with the base64 and subType child fields.  
    Public PropertyGets or sets the value of the field as a Boolean. Numbers and the TimeStamp and Date values give true when not zero, and a string is parsed. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. Setting a null reference (Nothing in Visual Basic) makes the field a BSON a null reference (Nothing in Visual Basic).  
    Public PropertyGets or sets the value of the field as a Byte. Double, String, Boolean, Int32, and Int64 values are converted; a value out of range throws System.OverflowException. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Int32.  
    Public PropertyGets or sets the value of the field as a Char; a String field must contain exactly one character. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidCastException for the other types. The value is written as a String.  
    Public PropertyGets or sets the value of the field as the text of JavaScript code. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types, including code with scope.  
    Public PropertyGets or sets the value of the field as a DateTime. A BSON date and a TimeStamp are returned in the DateTimeKind of the document, a string is parsed, and a number is taken as a count of ticks. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as a BSON date; a value of the Unspecified kind is taken for the DateTimeKind of the document.  
    Public PropertyGets or sets the value of the field as a DateTimeOffset. A BSON date gets the offset of the DateTimeKind of the document, a value in the form of the DateTimeOffsetFormat of the document is read as is, and a string is parsed. Returns a null reference (Nothing in Visual Basic) for a missing field or a BSON a null reference (Nothing in Visual Basic); throws System.InvalidOperationException for the other types. The value is written in the DateTimeOffsetFormat of the document; with MongoDBDateTimeOffsetFormat.DateTime it is stored as a BSON date in UTC without the offset.  
    Public PropertyGets or sets the value of the field as a Decimal. Double, String, Boolean, Int32, Int64, TimeStamp, and Decimal128 values are converted; a Decimal128 value out of the Decimal range, NaN, or Infinity throws System.OverflowException. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Decimal128.  
    Public PropertyGets or sets the value of the field as the exact text of a Decimal128 value, for example "1.50" or "NaN". Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types.  
    Public PropertyGets or sets the value of the field as a double-precision floating-point number. Double, String, Boolean, Int32, Int64, TimeStamp, and Decimal128 values are converted. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Double.  
    Public PropertyGets or sets the value of the field as a single-precision floating-point number. Double, String, Boolean, Int32, Int64, TimeStamp, and Decimal128 values are converted. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Double.  
    Public PropertyGets or sets the value of the field as a Guid. A binary value of subtype 4, or of subtype 3 in the byte order of the GuidFormat of the document, is read as a UUID, and a string is parsed. Returns a null reference (Nothing in Visual Basic) for a missing field or a BSON a null reference (Nothing in Visual Basic); throws System.InvalidCastException for other binary data and System.InvalidOperationException for the other types. The value is written in the GuidFormat of the document.  
    Public PropertyGets or sets the value of the field as a 16-bit signed integer. Double, String, Boolean, Int32, and Int64 values are converted; a value out of range throws System.OverflowException. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Int32.  
    Public PropertyGets or sets the value of the field as a 32-bit signed integer. Double, String, Boolean, Int32, and Int64 values are converted. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Int32.  
    Public PropertyGets or sets the value of the field as a 64-bit signed integer. Double, String, Boolean, Int32, and Int64 values are converted; a TimeStamp gives its seconds in the high 32 bits and its increment in the low 32 bits. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as Int64.  
    Public PropertyReturns this field, marked to be written as an embedded document; use it to set child fields or to assign a MongoDBObject or JSON text to Value.  
    Public PropertyGets or sets the value of the field as the 24-character hexadecimal text of an ObjectId. Returns a null reference (Nothing in Visual Basic) for a missing field; throws System.InvalidOperationException for the other types. The value is written as an ObjectId in lower case.  
    Public PropertyReturns this field, marked to be written as a regular expression with the pattern and options child fields.  
    Public PropertyGets or sets the value of the field as a string. The getter returns the plain text of any value: the hexadecimal text of an ObjectId, the invariant-culture text of a number, the date in the "yyyy-MM-ddTHH:mm:ss.fffK" format, and JSON text for an embedded document, an array, and the other composite types. Returns a null reference (Nothing in Visual Basic) for a missing field and "a null reference (Nothing in Visual Basic)" for a BSON a null reference (Nothing in Visual Basic).  
    Public PropertyReturns this field, marked to be written as a BSON timestamp with the t and i child fields.  
    Public PropertyGets the number of child fields.  
    Public PropertyGets the collection of child fields. For a Binary field they are base64 and subType, for a Regex field pattern and options, for a TimeStamp field t and i.  
    Public PropertyGets the dot-separated path of the field from the root of the document, for example "a.2.k".  
    Public PropertyGets a value indicating whether the field has child fields by its type: Object, Array, TimeStamp, Regex, Code, ScopeCode, or Binary.  
    Public PropertyOverloaded. Gets the child field with the specified name or dot-separated path; equivalent to GetField.  
    Public PropertyGets the length of the text of the field value.  
    Public PropertyGets the name of the field within its parent; for an array item, the name is its index.  
    Public PropertyGets the length of the value for the Oid, String, Regex, Code, and ScopeCode types; returns -1 for the other types.  
    Public PropertyGets the BSON type of the field; MongoDBType.Uninitialized for a field that the document does not contain.  
    Public PropertyGets or sets the value of the field. The getter returns double, string, bool, DateTime, int, long, Guid, or DateTimeOffset by the BSON type, a null reference (Nothing in Visual Basic) for a a null reference (Nothing in Visual Basic) or missing field, and the text of the value (as AsString) for the other types. The setter creates a missing field and its missing parents; the BSON type is taken from the .NET type of the value unless one of the As... properties set it.  
    Top
    Public Methods
     NameDescription
    Public MethodReturns the child field with the specified name or dot-separated path. If there is no such field, returns a field of the Uninitialized type that creates the field when a value is assigned to it.  
    Public MethodRemoves the child field with the specified name or dot-separated path from the document; the following items of an array are renumbered.  
    Top
    See Also