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

com.google.cloud.datastore.DatastoreException: The value of property is longer than 1500 bytes #1246

Closed
ghorkov opened this issue Sep 16, 2016 · 3 comments
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@ghorkov
Copy link

ghorkov commented Sep 16, 2016

Hello,

I'm using the new google-cloud-datastore 0.3.0

I'm trying to write a json object into the datastore, this object can be larger than 1500 bytes.

This is my code:

Entity entity = Entity.builder(syncKey) .set("id", objId) .set("json_obj", Blob.copyFrom(objJson.toString().getBytes())) .set("status", "on_progress") .set("type", syncLocation) .set("started_at", DateTime.now()) .build(); datastore.put(entity);

And I'm getting this exception:
"Code: 3 Message: The value of property "json_obj" is longer than 1500 bytes. - com.google.cloud.datastore.DatastoreException: The value of property "json_obj" is longer than 1500 bytes.

I thought the blob object didn't have a 1500 bytes restriction.

Is it possible to specify with the API that this property should not be indexed?

@ghorkov ghorkov closed this as completed Sep 16, 2016
@ghorkov ghorkov reopened this Sep 16, 2016
@mziccard mziccard added the api: datastore Issues related to the Datastore API. label Sep 16, 2016
@mziccard
Copy link
Contributor

Hi @ghorkov, thanks for the report!

Is it possible to specify with the API that this property should not be indexed?

Sure, you should be able to do that with:

Blob blob = Blob.copyFrom(objJson.toString().getBytes());
Entity entity = Entity.builder(key)
    .set("id", objId)
    .set("json_obj", BlobValue.builder(blob).excludeFromIndexes(true).build())
    .set("status", "on_progress")
    .set("type", syncLocation)
    .set("started_at", DateTime.now())
    .build();
datastore.put(entity);

Please let us know if this fixes your problem.

@ghorkov
Copy link
Author

ghorkov commented Sep 18, 2016

Thank you @mziccard it worked like magic :)

@ghorkov ghorkov closed this as completed Sep 18, 2016
@mrfambo
Copy link

mrfambo commented Dec 17, 2018

I am using API 2.0.0, what did you mean by Entity in here? How do i get its instance? Any recent resource on it?

github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jun 29, 2022
…esscontextmanager-v1 to v1.3.1 (googleapis#1246)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.api.grpc:proto-google-identity-accesscontextmanager-v1](https://togithub.com/googleapis/java-accesscontextmanager) | `1.3.0` -> `1.3.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-identity-accesscontextmanager-v1/1.3.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-identity-accesscontextmanager-v1/1.3.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-identity-accesscontextmanager-v1/1.3.1/compatibility-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-identity-accesscontextmanager-v1/1.3.1/confidence-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-accesscontextmanager</summary>

### [`v1.3.1`](https://togithub.com/googleapis/java-accesscontextmanager/blob/HEAD/CHANGELOG.md#&#8203;131-httpsgithubcomgoogleapisjava-accesscontextmanagercomparev130v131-2022-06-23)

[Compare Source](https://togithub.com/googleapis/java-accesscontextmanager/compare/v1.3.0...v1.3.1)

##### Dependencies

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#&googleapis#8203;346](https://togithub.com/googleapis/java-accesscontextmanager/issues/346)) ([7cbfabd](https://togithub.com/googleapis/java-accesscontextmanager/commit/7cbfabdd0e6a011d8b5045805a321d2a3e8f34f9))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this issue Jul 1, 2022
🤖 I have created a release *beep* *boop*
---


## [3.4.0](googleapis/java-asset@v3.3.1...v3.4.0) (2022-06-30)


### Features

* Enable REST transport for most of Java and Go clients ([googleapis#1242](googleapis/java-asset#1242)) ([86eb248](googleapis/java-asset@86eb248))


### Bug Fixes

* update gapic-generator-java with mock service generation fixes ([googleapis#1249](googleapis/java-asset#1249)) ([7d124ad](googleapis/java-asset@7d124ad))


### Dependencies

* update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.2.1 ([googleapis#1245](googleapis/java-asset#1245)) ([9b0d4e9](googleapis/java-asset@9b0d4e9))
* update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.101.0 ([googleapis#1228](googleapis/java-asset#1228)) ([c5f1712](googleapis/java-asset@c5f1712))
* update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.101.1 ([googleapis#1233](googleapis/java-asset#1233)) ([42031ef](googleapis/java-asset@42031ef))
* update dependency com.google.api.grpc:proto-google-identity-accesscontextmanager-v1 to v1.3.1 ([googleapis#1246](googleapis/java-asset#1246)) ([d868803](googleapis/java-asset@d868803))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.1 ([googleapis#1227](googleapis/java-asset#1227)) ([113c52f](googleapis/java-asset@113c52f))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.3 ([googleapis#1234](googleapis/java-asset#1234)) ([7006c44](googleapis/java-asset@7006c44))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.4 ([googleapis#1239](googleapis/java-asset#1239)) ([9c59632](googleapis/java-asset@9c59632))
* update dependency com.google.cloud:google-cloud-bigquery to v2.13.6 ([googleapis#1244](googleapis/java-asset#1244)) ([a305745](googleapis/java-asset@a305745))
* update dependency com.google.cloud:google-cloud-core to v2.8.0 ([googleapis#1238](googleapis/java-asset#1238)) ([8224b02](googleapis/java-asset@8224b02))
* update dependency com.google.cloud:google-cloud-resourcemanager to v1.4.0 ([googleapis#1230](googleapis/java-asset#1230)) ([5655582](googleapis/java-asset@5655582))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([googleapis#1241](googleapis/java-asset#1241)) ([2ebe221](googleapis/java-asset@2ebe221))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this issue Sep 19, 2022
🤖 I have created a release *beep* *boop*
---


## [2.3.10](googleapis/java-automl@v2.3.9...v2.3.10) (2022-09-15)


### Dependencies

* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1245](googleapis/java-automl#1245)) ([d010d14](googleapis/java-automl@d010d14))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Projects
None yet
Development

No branches or pull requests

3 participants