in datastore, how can i write long text over 1500 byte

1,396 views
Skip to first unread message

김진형

unread,
Apr 16, 2017, 12:06:09 PM4/16/17
to Google App Engine
i wonder how to save longtext data in node.js


when datastore web page
i can select 'text' type

but in nodejs i can't find how to string to text type

please help


i do not want to see that error message:
Error: The value of property "content" is longer than 1500 bytes.

Adam (Cloud Platform Support)

unread,
Apr 16, 2017, 1:07:48 PM4/16/17
to Google App Engine
You'll need to save the text as an unindexed property. To do this, you need to store the value explicitly as an array to specify excludeFromIndexes: true, eg.

var entity = { key: datastore.key('Company'), data: [ { name: 'description', value: "Some long text greater than 1500 bytes ...", excludeFromIndexes: true } ] };

More details can be found in the documentation for google-cloud-node.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages