Should not throw TypeError when saving null
for a field with subproperty index-exclusion
#1327
Labels
api: datastore
Issues related to the googleapis/nodejs-datastore API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
@google-cloud/datastore
version: v9.1.0, but in earlier versions tooProblem statement
Considering the following 4 types of index exclusions:
excludeFromindexes: ['foo.*']
excludeFromindexes: ['foo.bar']
excludeFromindexes: ['foo[].*']
excludeFromindexes: ['foo[].bar']
Supplying
{ entity: { foo: null } }
throws for 2 and 3, but not for 1 and 4.It should either throw in all cases or in none. I think it should throw in none, and it is easily fixable.
Steps to reproduce
Easily reproducable via unit tests:
repo with unit test showcasing error
Proposed solution
This TypeError can be fixed with 2 lines of code and I am ready to open a PR.
The text was updated successfully, but these errors were encountered: