Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
calsmith opened this issue May 22, 2023 · 1 comment
Assignees
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@calsmith
Copy link

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

@calsmith calsmith added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels May 22, 2023
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label May 22, 2023
@danieljbruce danieljbruce self-assigned this May 23, 2023
@danieljbruce
Copy link
Contributor

To support this feature we should write code to create and delete indexes. The following link shows this is not supported yet.

// @TODO implement create()
// @TODO implement delete()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants