MongoDBCommand Class Members
On this page
The following tables list the members exposed by MongoDBCommand.
Public Constructors
Public Properties
| | Name | Description |
 | CommandText | Overridden. 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. |
 | CommandTimeout | Gets 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) |
 | CommandType | Overridden. 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. |
 | Connection | Gets or sets the MongoDBConnection used by this command. The default value is a null reference (Nothing in Visual Basic). |
 | Container | (Inherited from System.ComponentModel.Component) |
 | Owner | Gets or sets a form or other container that the Devart.Common.DbCommandBase instance belongs to. (Inherited from Devart.Common.DbCommandBase) |
 | ParameterCheck | Gets or sets a value indicating whether the command object regenerates parameter objects if text of the command is changed. (Inherited from Devart.Common.DbCommandBase) |
 | Parameters | Gets 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. |
 | ReaderType | Gets 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. |
 | Site | (Inherited from System.ComponentModel.Component) |
 | Transaction | (Inherited from System.Data.Common.DbCommand) |
 | UpdatedRowSource | Gets 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
Public Methods
| | Name | Description |
 | BeginExecuteNonQuery | Overloaded. Starts an asynchronous invocation of an ExecuteNonQuery method. (Inherited from Devart.Common.DbCommandBase) |
 | BeginExecuteReader | Overloaded. Starts an asynchronous invocation of an System.Data.Common.DbCommand.ExecuteReader method. (Inherited from Devart.Common.DbCommandBase) |
 | Cancel | Overridden. 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. |
 | Clone | Creates a copy of the command with the same connection, command text, command type, CommandTimeout, UpdatedRowSource, ParameterCheck, ReaderType, and copies of its parameters. |
 | CreateObjRef | (Inherited from System.MarshalByRefObject) |
 | CreateParameter | Creates a new MongoDBParameter object. |
 | Dispose | Overloaded. (Inherited from Devart.Common.DbCommandBase) |
 | EndExecuteNonQuery | Ends an asynchronous invocation of the ExecuteNonQuery method. (Inherited from Devart.Common.DbCommandBase) |
 | EndExecuteReader | Finishes the asynchronous execution of the command started with BeginExecuteReader and returns a MongoDBDataReader. |
 | ExecuteArray | Overloaded. (Inherited from Devart.Common.DbCommandBase) |
 | ExecuteNonQuery | Executes SQL statement against the System.Data.Common.DbCommand.Connection and returns the number of rows affected. (Inherited from Devart.Common.DbCommandBase) |
 | ExecutePageReader | Executes 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. |
 | ExecuteReader | Overloaded. Sends the CommandText to the Connection and builds a MongoDBDataReader. |
 | ExecuteReaderAsync | Overloaded. Executes the command asynchronously and returns a task whose result is a MongoDBDataReader. |
 | ExecuteScalar | Executes 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) |
 | GetLifetimeService | (Inherited from System.MarshalByRefObject) |
 | GetRecordCount | Returns count of records in the resultset. (Inherited from Devart.Common.DbCommandBase) |
 | InitializeLifetimeService | (Inherited from System.MarshalByRefObject) |
 | Prepare | Overridden. 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. |
 | PrepareCore | (Inherited from Devart.Common.DbCommandBase) |
 | ResetCommandTimeout | Resets CommandTimeout to its default value, which is taken from DefaultCommandTimeout. (Inherited from Devart.Common.DbCommandBase) |
 | ToString | (Inherited from System.ComponentModel.Component) |
Top
Public Events
See Also