Skip to content

datastore: allow nested unindexed properties#2497

Merged
stephenplusplus merged 3 commits intogoogleapis:masterfrom
stephenplusplus:spp--1916
Aug 1, 2017
Merged

datastore: allow nested unindexed properties#2497
stephenplusplus merged 3 commits intogoogleapis:masterfrom
stephenplusplus:spp--1916

Conversation

@stephenplusplus
Copy link
Copy Markdown
Contributor

@stephenplusplus stephenplusplus commented Jul 28, 2017

Fixes #1916

To Dos

  • Docs
  • System tests
  • Unit tests

This will allow excluding embedded properties from indexing, using the solution discussed here. Here is the sample from our system tests:

datastore.save({
  key: datastore.key('Kind'),
  data: {
    longString: longString,
    notMetadata: true,
    metadata: {
      longString: longString,
      otherProperty: 'value',
      longStringArray: [
        {
          longString: longString,
          nestedLongStringArray: [
            {
              longString: longString,
              nestedProperty: true
            },
            {
              longString: longString
            }
          ]
        }
      ]
    }
  },
  excludeFromIndexes: [
    'longString',
    'metadata.longString',
    'metadata.longStringArray[].longString',
    'metadata.longStringArray[].nestedLongStringArray[].longString'
  ]
})

@stephenplusplus stephenplusplus added api: datastore Issues related to the Datastore API. status: do not merge labels Jul 28, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 28, 2017
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling ada4d67 on stephenplusplus:spp--1916 into 105f28b on GoogleCloudPlatform:master.

return entityProto;

function excludePathFromEntity(entity, path) {
var arrayIndex = path.indexOf('[]');

This comment was marked as spam.

This comment was marked as spam.

assert.ifError(err);

assert.deepEqual(entity, data);
assert.deepEqual(entity[datastore.KEY], postKey);

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus merged commit 2551ea4 into googleapis:master Aug 1, 2017
sofisl pushed a commit that referenced this pull request Feb 25, 2026
…er (#2497)

* feat: add function to allow user to set destination in transfer manager

* lint
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request Mar 18, 2026
…er (googleapis#2497)

* feat: add function to allow user to set destination in transfer manager

* lint
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 Datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants