new collection modal refactor

This commit is contained in:
Jan Prochazka
2024-08-22 09:43:33 +02:00
parent 869e837ee5
commit 77b42e6a04
11 changed files with 67 additions and 25 deletions

View File

@@ -109,7 +109,7 @@ const driver = {
const { type } = operation;
switch (type) {
case 'createCollection':
await this.script(pool, `db.createCollection('${operation.collection}')`);
await this.script(pool, `db.createCollection('${operation.collection.name}')`);
case 'dropOperation':
await this.script(pool, `db.dropCollection('${operation.collection}')`);
default:

View File

@@ -44,6 +44,8 @@ const driver = {
{ label: 'Max duration', field: 'maxDuration' },
],
databaseUrlPlaceholder: 'e.g. mongodb://username:password@mongodb.mydomain.net/dbname',
collectionSingularLabel: 'collection',
collectionPluralLabel: 'collections',
getQuerySplitterOptions: () => mongoSplitterOptions,
@@ -65,7 +67,7 @@ const driver = {
},
],
getCollectionUpdateScript(changeSet) {
getCollectionUpdateScript(changeSet, collectionInfo) {
let res = '';
for (const insert of changeSet.inserts) {
res += `db.${insert.pureName}.insertOne(${jsonStringifyWithObjectId({