update mongo data

This commit is contained in:
Jan Prochazka
2021-04-05 15:09:03 +02:00
parent 6c2ee5ffdb
commit ccb1c26905
5 changed files with 70 additions and 9 deletions

View File

@@ -105,6 +105,17 @@ async function handleCollectionData({ msgid, options }) {
}
}
async function handleUpdateCollection({ msgid, changeSet }) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
try {
const result = await driver.updateCollection(systemConnection, changeSet);
process.send({ msgtype: 'response', msgid, result });
} catch (err) {
process.send({ msgtype: 'response', msgid, errorMessage: err.message });
}
}
async function handleSqlPreview({ msgid, objects, options }) {
await waitConnected();
const driver = requireEngineDriver(storedConnection);
@@ -140,6 +151,7 @@ function handlePing() {
const messageHandlers = {
connect: handleConnect,
queryData: handleQueryData,
updateCollection: handleUpdateCollection,
collectionData: handleCollectionData,
sqlPreview: handleSqlPreview,
ping: handlePing,