Skip to content

Commit 9208138

Browse files
committed
fix: Require $ prefix in aggregate field expressions
1 parent 8af6e28 commit 9208138

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ const transformAggregateField = fieldName => {
250250
if (fieldName === '$_updated_at') {
251251
return 'updatedAt';
252252
}
253+
if (!fieldName.startsWith('$')) {
254+
throw new Parse.Error(Parse.Error.INVALID_KEY_NAME, `Invalid field name: ${fieldName}`);
255+
}
253256
const name = fieldName.substring(1);
254257
validateAggregateFieldName(name);
255258
return name;

0 commit comments

Comments
 (0)