When storing String
fields with App Engine:
- What is the maximum
length()
of theString
that App Engine datastore can handle? - Also if using Objectify, is this max length the same or Objectify does some processing that affect this max length?
When storing String
fields with App Engine:
length()
of the String
that App Engine
datastore can handle?Objectify will automatically convert Strings of more than 500 characters to native Text storage. Be careful if you are indexing strings; Text objects are not indexed so the String > 500 chars will be unindexed.
I think the responses to this one are out of date, so I am updating. I'm using GAE version 1.9.22 and received this in the error logs:
String properties must be 1500 bytes or less. Instead, use com.google.appengine.api.datastore.Text, which can store strings of any length.
Using com.google.appengine.api.datastore.Text works well by converting the String object to Text (e.g., new Text(thisString) on the server side of your code. Any reference to libraries in com.google.appengine.api.datastore.* do not work on the client side. Class not found.
Per the documentation, 500 characters. And no, Objectify is a wrapper and does not modify your data, so the data size limitations are unchanged.
Based on updates to Google Datastore documentation from October, 2016, here are the limits
Maximum size of an indexed string property's UTF-8 encoding: 1,500 bytes
Maximum size for an unindexed property: 1,048,487 bytes (1 MiB - 89 bytes)
So you can store strings close to 1MB in size in an unindexed String
property.
© 2022 - 2024 — McMap. All rights reserved.