BadValueError: Property Value is 501 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.
To store long strings in the datastore, you'll need to manually convert a string type to a byte slice (
[]byte
), which will be stored as an unindexed blob. For example:
type T struct {
LongString []byte
}
func store(longString string, r *http.Request) os.Error {
ctx := appengine.NewContext(r)
key := datastore.NewIncompleteKey(ctx, "T", nil)
t := new(T)
t.LongString = []byte(longString)
_, e := datastore.Put(ctx, key, t)
return e
}
As of the last update this limitation is gone for noindex strings.
ReplyDelete