Skip to content

Commit 0025efe

Browse files
Merge ba573dd into df36a24
2 parents df36a24 + ba573dd commit 0025efe

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/firestore/src/api/user_data_reader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ function parseSentinelFieldValue(
623623
`${value._methodName}() can only be used with update() and set()`
624624
);
625625
}
626-
if (context.path === null) {
626+
if (!context.path) {
627627
throw context.createError(
628628
`${value._methodName}() is not currently supported inside arrays`
629629
);

packages/firestore/test/integration/api/validation.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,18 @@ apiDescribe('Validation:', (persistence: boolean) => {
470470
}
471471
);
472472

473+
validationIt(
474+
persistence,
475+
'must not contain field value transforms in arrays',
476+
db => {
477+
return expectWriteToFail(
478+
db,
479+
{ 'array': [FieldValue.serverTimestamp()] },
480+
'FieldValue.serverTimestamp() is not currently supported inside arrays'
481+
);
482+
}
483+
);
484+
473485
validationIt(
474486
persistence,
475487
'must not contain directly nested arrays.',

0 commit comments

Comments
 (0)