how to declare long string for datastore

38 views
Skip to first unread message

qingsh...@gmail.com

unread,
May 4, 2015, 7:37:51 PM5/4/15
to google-ap...@googlegroups.com
Hi,

I am using go-appengine's datasore to store some piece of short articles but to exceed 1500 byte limit for (short) string type I have to use "long string" type instead. Could anyone show me how to declare the long string field?

type Article struct {
    Title string
    Content long string

}

thanks


Glenn Lewis

unread,
May 4, 2015, 7:44:17 PM5/4/15
to qingsh...@gmail.com, google-appengine-go
type Article struct {
    Title string
    Content string `datastore:"content,noindex"`
}

-- Glenn

--
You received this message because you are subscribed to the Google Groups "google-appengine-go" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

qingsh...@gmail.com

unread,
May 4, 2015, 11:37:13 PM5/4/15
to google-ap...@googlegroups.com, qingsh...@gmail.com
It works. Except I need use

Content string `datastore:"Content,noindex"` // capital "C"

or 

Content string `datastore:",noindex"`

Thanks,
Qingshan
Reply all
Reply to author
Forward
0 new messages