Search Results for

    Show / Hide Table of Contents

    Class DbDoc

    Represents a generic document in JSON format.

    Inheritance
    Object
    DbDoc
    Namespace: MySqlX.XDevAPI
    Assembly: MySql.Data.dll
    Version: 8.0.33
    Syntax
    public class DbDoc

    Constructors

    DbDoc(Object)

    Initializes a new instance of the DbDoc class based on the object provided. The value can be a domain object, anonymous object, or JSON string.

    Declaration
    public DbDoc(object val = null)
    Parameters
    Type Name Description
    Object val

    The value for this DbDoc.

    Properties

    HasId

    Gets a value indicating if this document has an identifier (property named _id with a value).

    Declaration
    public bool HasId { get; }
    Property Value
    Type Description
    Boolean

    Id

    Gets the identifier of the document.

    Declaration
    public object Id { get; }
    Property Value
    Type Description
    Object

    Item[String]

    Gets the value of a document property.

    Declaration
    public object this[string path] { get; }
    Parameters
    Type Name Description
    String path

    The key path for the property.

    Property Value
    Type Description
    Object

    Methods

    Equals(Object)

    Compares this DbDoc with another one.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The DbDoc to compare to.

    Returns
    Type Description
    Boolean

    True if they are equal, false otherwise.

    Overrides
    Object.Equals(Object)

    GetHashCode()

    Gets a value that serves as a hash function for a particular type.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for the current object.

    Overrides
    Object.GetHashCode()

    SetValue(String, Object)

    Sets a property on this document.

    Declaration
    public void SetValue(string key, object val)
    Parameters
    Type Name Description
    String key

    The key of the property.

    Object val

    The new property value.

    ToString()

    Returns this document in Json format.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A Json formatted string.

    Overrides
    Object.ToString()
    In This Article
    Back to top Copyright © 2021, 2023, Oracle and/or its affiliates.