go - Making a Google App Engine datastore key from a string -


I am passing "id" entities as a string on a URL, for example:

  .... / foo / 234565  

I want to use the ID in the following query:

  //. .. I grace some code that gets the string id from the URL, and I have verified that this string id = .... works IKey, err: = datastore.DecodeKey (stringId) q: = datastore.NewQuery ("Foo"). Filter ("__ key__ =", TheKey)  

I get the error:

  Protota: Do not leave unknown wire type 7 for datastore Could. Reference  

Is there any easy way to convert string ID into "key"?

  c: = appenzine Recover unit ID from newcountx (r) // submitted form. Change to an int64 entity_id: = r.FormValue ("entity_id") entity_id_int, err: = strconv.ParseInt (entity_id, 10, 64) If mistake! = Zero {fmt.print (w, "unable to parse the key") returns; } // We create a datastore key based on type and // unit ID (the HTTP request parameter has been passed to us. Key: = datastore.NewKey (c, kind, "", entity_id_int, zero ) // This unit represents the key to the Load. // We first have to set the variable, then the gate operation / conduct, so the datastore understands the structure reflecting the unit. Var unit CustomStat Datastore.Gate ( C, key, a Titi)  

Comments