Properly construct the query to delete Cassandra row (#388)

This commit is contained in:
victor-meng 2021-01-14 14:59:31 -08:00 committed by GitHub
parent 9a1e8b2d87
commit 9afa29cdb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,9 +312,10 @@ export class CassandraAPIDataClient extends TableDataClient {
const clearMessage = NotificationConsoleUtils.logConsoleProgress(`Deleting row ${currEntityToDelete.RowKey._}`); const clearMessage = NotificationConsoleUtils.logConsoleProgress(`Deleting row ${currEntityToDelete.RowKey._}`);
const partitionKeyValue = currEntityToDelete[partitionKeyProperty]; const partitionKeyValue = currEntityToDelete[partitionKeyProperty];
const currQuery = const currQuery =
query + this.isStringType(partitionKeyValue.$) query +
(this.isStringType(partitionKeyValue.$)
? `${partitionKeyProperty} = '${partitionKeyValue._}'` ? `${partitionKeyProperty} = '${partitionKeyValue._}'`
: `${partitionKeyProperty} = ${partitionKeyValue._}`; : `${partitionKeyProperty} = ${partitionKeyValue._}`);
try { try {
await this.queryDocuments(collection, currQuery); await this.queryDocuments(collection, currQuery);