Skip to content

Add support for excludeFromIndexes in embedded entities#754

Merged
jdpedrie merged 2 commits intogoogleapis:masterfrom
jdpedrie:datastore-embedded-entities-ignore-indexes
Dec 11, 2017
Merged

Add support for excludeFromIndexes in embedded entities#754
jdpedrie merged 2 commits intogoogleapis:masterfrom
jdpedrie:datastore-embedded-entities-ignore-indexes

Conversation

@jdpedrie
Copy link
Copy Markdown
Contributor

@jdpedrie jdpedrie commented Nov 20, 2017

cc @maksimru

This change adds support for excluding properties of embedded entities from datastore indexes.

use Google\Cloud\Datastore\Entity;

$e = $datastore->entity('Person', [
    'entity' => [
        'prop' => 'val',
        Entity::EXCLUDE_FROM_INDEXES => ['prop']
    ]
]);

$datastore->insert($e);

We've added a todo item for the next major version to improve on this, but for the time being this is the best option to avoid a backwards-compatibility break.

@jdpedrie jdpedrie added the api: datastore Issues related to the Datastore API. label Nov 20, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 20, 2017
Comment thread src/Datastore/Connection/Rest.php Outdated
*/
public function commit(array $args)
{
// print_r($args);exit;

This comment was marked as spam.

@jdpedrie jdpedrie merged commit cfd5db5 into googleapis:master Dec 11, 2017
@jdpedrie jdpedrie deleted the datastore-embedded-entities-ignore-indexes branch December 11, 2017 20:03
@jdpedrie jdpedrie mentioned this pull request Dec 15, 2017
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.

3 participants