Commit 45899207 authored by Yunhua Koglin's avatar Yunhua Koglin Committed by Rucha Deshpande
Browse files

fix select for path

commit 7f291d9b 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Tue Jan 26 2021 13:16:44 GMT-0600 (Central Standard Time) 

    change path


commit 1d669913 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Mon Jan 25 2021 10:41:20 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit 6d4ed46f 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Mon Jan 25 2021 09:28:39 GMT-0600 (Central Standard Time) 

    remove id attribute in get


commit f96ed097 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Sun Jan 24 2021 16:42:03 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit 127c9881 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Fri Jan 22 2021 10:11:54 GMT-0600 (Central Standard Time) 

    fix the storage


commit ab011a83 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Thu Jan 21 2021 15:29:00 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit b08276eb 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Thu Jan 21 2021 14:08:59 GMT-0600 (Central Standard Time) 

    fix the table name


commit 3e498ecf 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Thu Jan 21 2021 14:00:37 GMT-0600 (Central Standard Time) 

    add ENVIROMENT env


commit a0794cf7 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Wed Jan 20 2021 16:59:17 GMT-0600 (Central Standard Time) 

    add entry for app table, fix id for dataset


commit 7013750b 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Wed Jan 20 2021 14:56:20 GMT-0600 (Central Standard Time) 

    fix Journal, JournalTransaction and JournalQuery in dynamodb


commit a916a370 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Wed Jan 20 2021 14:54:11 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit bd12e513 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Sun Jan 17 2021 23:18:41 GMT-0600 (Central Standard Time) 

    Revert "update packages with aws-sdk"

This reverts commit fa7ba482aba74830daee7935a46daaf2cbdc3d33.


commit 64740dd9 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Sun Jan 17 2021 22:37:08 GMT-0600 (Central Standard Time) 

    add storage and dynamodb


commit 739900b4 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Fri Jan 15 2021 16:16:21 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit 5f969e3a 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Fri Jan 15 2021 15:47:49 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit 0ac28b3b 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Wed Jan 13 2021 11:35:28 GMT-0600 (Central Standard Time) 

    Merge branch 'dev' of codecommit://os-seismic-store-service into kogliny


commit fa7ba482 
Author: Yunhua Koglin <kogliny@amazon.com> 
Date: Tue Jan 12 2021 09:26:08 GMT-0600 (Central Standard Time) 

    update packages with aws-sdk
parent adbf6732
......@@ -259,7 +259,7 @@ export class AWSDynamoDbQuery implements IJournalQueryModel {
public constructor(namespace: string, kind: string) {
this.namespace = namespace;
this.kind = kind;
this.queryStatement = { TableName: kind, FilterExpression: '', ExpressionAttributeNames: {}, ExpressionAttributeValues: {} };
this.queryStatement = { TableName: kind, FilterExpression: '', ExpressionAttributeNames: {}, ExpressionAttributeValues: {}, ProjectionExpression:'' };
}
public namespace: string;
public kind: string;
......@@ -295,10 +295,19 @@ export class AWSDynamoDbQuery implements IJournalQueryModel {
this.queryStatement.FilterExpression += ' AND ';
}
this.queryStatement.FilterExpression += '#' + property + operator + ':' + property;
this.queryStatement.ExpressionAttributeNames['#' + property] = property;
this.queryStatement.ExpressionAttributeValues[':' + property] = value;
if(property ==='path')
{
property='p';
const pathproperty='path';
this.queryStatement.FilterExpression += '#' + property + operator + ':' + property;
this.queryStatement.ExpressionAttributeNames['#' + property] = pathproperty;
this.queryStatement.ExpressionAttributeValues[':' + property] = value;
}
else {
this.queryStatement.FilterExpression += '#' + property + operator + ':' + property;
this.queryStatement.ExpressionAttributeNames['#' + property] = property;
this.queryStatement.ExpressionAttributeValues[':' + property] = value;
}
return this;
}
......@@ -326,6 +335,9 @@ export class AWSDynamoDbQuery implements IJournalQueryModel {
if (typeof fieldNames === 'string') {
this.queryStatement.ProjectionExpression += fieldNames;
} else {
if(fieldNames[0] === 'path')
this.queryStatement.ProjectionExpression += '#p';
else
this.queryStatement.ProjectionExpression += fieldNames.join(',');
}
return this;
......@@ -363,8 +375,12 @@ export class AWSDynamoDbQuery implements IJournalQueryModel {
this.queryStatement.ExpressionAttributeNames['#' + t_property] = t_property;
this.queryStatement.ExpressionAttributeValues[':' + t_property] = value;
}
if (this.queryStatement.FilterExpression.length === 0)
delete this.queryStatement.FilterExpression;
if (this.queryStatement.ProjectionExpression.length === 0)
delete this.queryStatement.ProjectionExpression;
//delete empty objects in query parameters
if (Object.entries(this.queryStatement.ExpressionAttributeNames).length === 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment