-
Notifications
You must be signed in to change notification settings - Fork 158
Labels
api: firestoreIssues related to the googleapis/nodejs-firestore API.Issues related to the googleapis/nodejs-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: MacOS
- Node.js version: latest
- npm version: latest
@google-cloud/firestore
version: v7.3.1
Steps to reproduce
-
Try to use a FieldPath with multiple backslashes or backtick, for example:
query.where(new FieldPath('containing multiple `` or backslashes \\\\'), '==', 0)
-
Run the query, then you get:
3 INVALID_ARGUMENT: Invalid property path ...
This is because of the use of replace
in the following line:
nodejs-firestore/dev/src/path.ts
Line 624 in e598b9d
: '`' + str.replace('\\', '\\\\').replace('`', '\\`') + '`'; |
The
replace()
method only replaces the first occurence of the given pattern (see MDN for more info).albertnis and duncannz
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the googleapis/nodejs-firestore API.Issues related to the googleapis/nodejs-firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.