dotConnect for MongoDB Documentation
Devart.Data.MongoDB Namespace / MongoDBCommand Class
Fields Properties Methods Events


On this page
    MongoDBCommand Class Members
    On this page

    The following tables list the members exposed by MongoDBCommand.

    Public Constructors
     NameDescription
    Public ConstructorOverloaded. Initializes a new instance of the MongoDBCommand class.  
    Top
    Protected Fields
     NameDescription
    Protected FieldThe input parameters of the command prepared for execution.  
    Protected Field (Inherited from Devart.Common.DbCommandBase)
    Top
    Public Properties
     NameDescription
    Public PropertyOverridden. Gets or sets the text of the command: a MongoDB JSON command (for example, {"find": "orders", "filter": {}}) in the native mode, an SQL statement in the SQL engine mode, or a collection name when CommandType is TableDirect. The default value is an empty string.  
    Public PropertyGets or sets the wait time before terminating an attempt to execute a command and generating an error. Note that it is the time to wait for any server reply since the command was sent to a server, and it doesn't include the time necessary to fetch data if the command selects some data. (Inherited from Devart.Common.DbCommandBase)
    Public PropertyOverridden. Gets or sets how the CommandText property is interpreted. Text and TableDirect are supported; for TableDirect the command reads all documents of the collection named in CommandText. StoredProcedure is not supported. The default value is System.Data.CommandType.Text.  
    Public PropertyGets or sets the MongoDBConnection used by this command. The default value is a null reference (Nothing in Visual Basic).  
    Public Property (Inherited from System.ComponentModel.Component)
    Public PropertyGets or sets a form or other container that the Devart.Common.DbCommandBase instance belongs to. (Inherited from Devart.Common.DbCommandBase)
    Public PropertyGets or sets a value indicating whether the command object regenerates parameter objects if text of the command is changed. (Inherited from Devart.Common.DbCommandBase)
    Public PropertyGets the MongoDBParameterCollection of the command. Parameters are marked in the command text as :name, @name, or ?. In the native mode their values are written into the JSON command as Extended JSON; in the SQL engine mode they are bound by the SQL engine.  
    Public PropertyGets or sets how a native-mode command returns documents: MongoDBReaderType.Default returns a column per field, MongoDBReaderType.Document returns each document as one value (see MongoDBDataReader.GetDocument). If the property is not set, the Reader Type of the connection is used; without a connection, MongoDBReaderType.Default. Ignored in the SQL engine mode.  
    Public Property (Inherited from System.ComponentModel.Component)
    Public Property (Inherited from System.Data.Common.DbCommand)
    Public PropertyGets or sets how command results are applied to the System.Data.DataRow when used by the System.Data.Common.DbDataAdapter.Update(System.Data.DataSet) method of the System.Data.Common.DbDataAdapter. (Inherited from Devart.Common.DbCommandBase)
    Top
    Protected Properties
     NameDescription
    Protected Property (Inherited from System.ComponentModel.Component)
    Protected Internal Property (Inherited from Devart.Common.DbCommandBase)
    Protected PropertyOverridden. Gets or sets the connection of the command.  
    Protected PropertyOverridden. Gets the parameter collection of the command.  
    Protected PropertyOverridden. Gets the current transaction of the command's connection; a value set to it is ignored.  
    Protected Property (Inherited from System.ComponentModel.Component)
    Protected Property (Inherited from System.ComponentModel.Component)
    Protected Internal Property (Inherited from Devart.Common.DbCommandBase)
    Protected Internal Property (Inherited from Devart.Common.DbCommandBase)
    Protected PropertyOverridden. Gets the failover manager of the command's connection.  
    Protected Internal Property (Inherited from Devart.Common.DbCommandBase)
    Protected Internal Property (Inherited from Devart.Common.DbCommandBase)
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded. Starts an asynchronous invocation of an ExecuteNonQuery method. (Inherited from Devart.Common.DbCommandBase)
    Public MethodOverloaded. Starts an asynchronous invocation of an System.Data.Common.DbCommand.ExecuteReader method. (Inherited from Devart.Common.DbCommandBase)
    Public MethodOverridden. Attempts to cancel the execution of the command. In the SQL engine mode it stops the running statement, and the reader throws MongoDBException "The command was canceled". In the native mode it does nothing; use CommandTimeout to limit the execution time.  
    Public MethodCreates a copy of the command with the same connection, command text, command type, CommandTimeout, UpdatedRowSource, ParameterCheck, ReaderType, and copies of its parameters.  
    Public Method (Inherited from System.MarshalByRefObject)
    Public MethodCreates a new MongoDBParameter object.  
    Public MethodOverloaded.  (Inherited from Devart.Common.DbCommandBase)
    Public MethodEnds an asynchronous invocation of the ExecuteNonQuery method. (Inherited from Devart.Common.DbCommandBase)
    Public MethodFinishes the asynchronous execution of the command started with BeginExecuteReader and returns a MongoDBDataReader.  
    Public MethodOverloaded.  (Inherited from Devart.Common.DbCommandBase)
    Public MethodExecutes SQL statement against the System.Data.Common.DbCommand.Connection and returns the number of rows affected. (Inherited from Devart.Common.DbCommandBase)
    Public MethodExecutes the command and returns a MongoDBDataReader that reads only the specified range of records. In the native mode the range is passed as the skip and limit fields of the command.  
    Public MethodOverloaded. Sends the CommandText to the Connection and builds a MongoDBDataReader.  
    Public MethodOverloaded. Executes the command asynchronously and returns a task whose result is a MongoDBDataReader.  
    Public MethodExecutes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored. (Inherited from Devart.Common.DbCommandBase)
    Public Method (Inherited from System.MarshalByRefObject)
    Public MethodReturns count of records in the resultset. (Inherited from Devart.Common.DbCommandBase)
    Public Method (Inherited from System.MarshalByRefObject)
    Public MethodOverridden. Prepares the command for execution. During preparation the parameters are always taken from the command text, as with ParameterCheck set to true; the MongoDBParameter objects already in Parameters under the same names stay in the collection, so the values assigned to them after Prepare are used by every execution.  
    Public Method (Inherited from Devart.Common.DbCommandBase)
    Public MethodResets CommandTimeout to its default value, which is taken from DefaultCommandTimeout. (Inherited from Devart.Common.DbCommandBase)
    Public Method (Inherited from System.ComponentModel.Component)
    Top
    Protected Methods
     NameDescription
    Protected MethodOverridden. Registers the command in its connection.  
    Protected MethodOverridden. Registers the data reader in the connection of the command.  
    Protected MethodOverridden. Removes all parameters of the command.  
    Protected MethodOverridden. Creates a new MongoDBParameter object.  
    Protected Internal Method (Inherited from Devart.Common.DbCommandBase)
    Protected MethodOverridden. Returns the text that is sent for execution: in the native mode the JSON command with the parameter values substituted.  
    Protected MethodOverridden. Throws System.NotSupportedException: stored procedures are not supported.  
    Protected MethodOverridden. Throws System.NotSupportedException: stored procedures are not supported.  
    Protected MethodOverloaded.  (Inherited from Devart.Common.DbCommandBase)
    Protected Method (Inherited from Devart.Common.DbCommandBase)
    Protected Method (Inherited from System.ComponentModel.Component)
    Protected MethodOverridden. Returns the command that counts the records of the specified command. In the native mode it builds a count command from a find command and throws MongoDBException for other commands.  
    Protected Method (Inherited from System.ComponentModel.Component)
    Protected MethodOverloaded. Overridden. Executes the prepared statement and returns a MongoDBDataReader.  
    Protected MethodOverridden. Prepares the statement of the command for the native mode or the SQL engine mode.  
    Protected Method (Inherited from Devart.Common.DbCommandBase)
    Protected MethodOverloaded.  (Inherited from System.MarshalByRefObject)
    Protected MethodOverridden. Finds the parameter markers in the command text and fills the Parameters collection from them.  
    Protected Method (Inherited from Devart.Common.DbCommandBase)
    Protected MethodOverridden. Removes the command from its connection.  
    Protected Method (Inherited from Devart.Common.DbCommandBase)
    Protected Internal Method (Inherited from Devart.Common.DbCommandBase)
    Protected Method (Inherited from Devart.Common.DbCommandBase)
    Protected MethodOverridden. Releases the prepared statement of the command.  
    Protected Internal Method (Inherited from Devart.Common.DbCommandBase)
    Protected Method (Inherited from Devart.Common.DbCommandBase)
    Top
    Public Events
     NameDescription
    Public Event (Inherited from System.ComponentModel.Component)
    Top
    See Also