mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 04:26:01 +00:00
feat: use getColleciton syntax for mongo
This commit is contained in:
@@ -138,15 +138,18 @@ const driver = {
|
||||
await this.script(dbhan, `db.createCollection('${operation.collection.name}')`);
|
||||
break;
|
||||
case 'dropCollection':
|
||||
await this.script(dbhan, `db.dropCollection('${operation.collection}')`);
|
||||
await this.script(dbhan, `db.getCollection('${operation.collection}').drop()`);
|
||||
break;
|
||||
case 'renameCollection':
|
||||
await this.script(dbhan, `db.renameCollection('${operation.collection}', '${operation.newName}')`);
|
||||
await this.script(
|
||||
dbhan,
|
||||
`db.getCollection('${operation.collection}').renameCollection('${operation.newName}')`
|
||||
);
|
||||
break;
|
||||
case 'cloneCollection':
|
||||
await this.script(
|
||||
dbhan,
|
||||
`db.collection('${operation.collection}').aggregate([{$out: '${operation.newName}'}]).toArray()`
|
||||
`db.getCollection('${operation.collection}').aggregate([{$out: '${operation.newName}'}]).toArray()`
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user