@@ -295,12 +295,12 @@ const untransformObjectACL = ({_rperm, _wperm, ...output}) => {
295295}
296296
297297/**
298- * When querying, the fieldName may be compound, extract the base fieldName
298+ * When querying, the fieldName may be compound, extract the root fieldName
299299 * `temperature.celsius` becomes `temperature`
300300 * @param {string } fieldName that may be a compound field name
301- * @returns {string } the basename of the field
301+ * @returns {string } the root name of the field
302302 */
303- const getBaseFieldName = ( fieldName : string ) : string => {
303+ const getRootFieldName = ( fieldName : string ) : string => {
304304 return fieldName . split ( '.' ) [ 0 ]
305305}
306306
@@ -421,8 +421,8 @@ class DatabaseController {
421421 if ( fieldName . match ( / ^ a u t h D a t a \. ( [ a - z A - Z 0 - 9 _ ] + ) \. i d $ / ) ) {
422422 throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Invalid field name for update: ${ fieldName } ` ) ;
423423 }
424- const baseFieldName = getBaseFieldName ( fieldName ) ;
425- if ( ! SchemaController . fieldNameIsValid ( baseFieldName ) && ! isSpecialUpdateKey ( baseFieldName ) ) {
424+ const rootFieldName = getRootFieldName ( fieldName ) ;
425+ if ( ! SchemaController . fieldNameIsValid ( rootFieldName ) && ! isSpecialUpdateKey ( rootFieldName ) ) {
426426 throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Invalid field name for update: ${ fieldName } ` ) ;
427427 }
428428 } ) ;
@@ -910,8 +910,8 @@ class DatabaseController {
910910 if ( fieldName . match ( / ^ a u t h D a t a \. ( [ a - z A - Z 0 - 9 _ ] + ) \. i d $ / ) ) {
911911 throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Cannot sort by ${ fieldName } ` ) ;
912912 }
913- const baseFieldName = getBaseFieldName ( fieldName ) ;
914- if ( ! SchemaController . fieldNameIsValid ( baseFieldName ) ) {
913+ const rootFieldName = getRootFieldName ( fieldName ) ;
914+ if ( ! SchemaController . fieldNameIsValid ( rootFieldName ) ) {
915915 throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Invalid field name: ${ fieldName } .` ) ;
916916 }
917917 } ) ;
0 commit comments