Delete collection
Deletes the selected database collection
- Parameters
- Advanced call ?
Function DeleteCollection(Val Connection, Val Collection, Val Base = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Connection | --dbc | String, Arbitrary | ✔ | Connection or connection string |
| Collection | --coll | String | ✔ | Collection name |
| Base | --db | String | ✖ | Database name. Current database if not specified |
Returns
Map Of KeyAndValue - Operation result
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Address = "127.0.0.1:1234";
Login = "bayselonarrend";
Password = "12we...";
ConnectionParams = New Structure("authSource", "admin");
ConnectionString = OPI_MongoDB.GenerateConnectionString(Address, , Login, Password, ConnectionParams);
Connection = OPI_MongoDB.CreateConnection(ConnectionString);
Collection = "test_collection";
Base = "test_database";
Result = OPI_MongoDB.DeleteCollection(Connection, Collection, Base);
- Bash
- CMD/Bat
oint mongodb DeleteCollection \
--dbc "mongodb://bayselonarrend:12we3456!2154@127.0.0.1:27017/?authSource=admin" \
--coll "test_collection" \
--db "test_database"
oint mongodb DeleteCollection ^
--dbc "mongodb://bayselonarrend:12we3456!2154@127.0.0.1:27017/?authSource=admin" ^
--coll "test_collection" ^
--db "test_database"
Result
{
"result": true,
"data": {
"nIndexesWas": 1,
"ns": "test_database.test_collection",
"ok": 1
}
}