Skip to content

Support retrieving and editing excludeFromIndexes (parity with other client libraries) #1111

Open
@calsmith

Description

@calsmith

Is your feature request related to a problem? Please describe.
There is no way to get/set which fields of an entity are indexed after initial entity creation.

Use case:

  1. Retrieve an entity
  2. Add a new field to the entity
  3. Exclude the new field from being indexed

Unlike the other client libraries, there is no way to achieve this with Node JS.

Describe the solution you'd like
Here's example code from the PHP Datastore library which easily enables this use case:

$ds = Datastore::get();
$entity = $ds->lookup($ds->key(...));
$entity["newField"] = 123;
$unindexedFields = $entity->excludedProperties(); // Get the unindexed fields.
$unindexedFields[] = "newField"; // Prevent the new field from being indexed.
$entity->setExcludeFromIndexes($unindexedFields);
$ds->update($entity);

Describe alternatives you've considered
Without this functionality, we cannot use Node JS or this library for our project.

Additional context
Related requests from other customers:
#914
#935

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the googleapis/nodejs-datastore API.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions