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

datastore: allow nested unindexed properties #2497

Merged
merged 3 commits into from Aug 1, 2017

Conversation

stephenplusplus
Copy link
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
Stephen Sawchuk added 2 commits August 1, 2017 11:29
@coveralls
Copy link

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.

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.

None yet

4 participants