Why does a query work in the console but not from REST API??

12 views
Skip to first unread message

betseyb

unread,
Oct 23, 2012, 5:03:12 PM10/23/12
to ne...@googlegroups.com
I am able to perform the following query successfully in the web console:

start r =  relationship(12) set r.StartDate = 32677200000, r.EndDate = 1350964800000,  r.ModifiedBy = "betseyb", r.LastModified = 1351025496374 return r

However, when I try to use the REST interface with the following entity:

{
"query": "start r =  relationship({id}) set r.StartDate = {start}, r.EndDate = {end}, r.ModifiedBy = {user}, r.LastModified = {date} return r",
"params": {
"id": 12,
"start": 32677200000,
"end": 1350964800000,
"user": "betseyb",
"date": 1351025985441
}
}


I get a 'bad request' error.  I"m using the same code to send the request that I use for all kinds of other queries.  I"m stumped.

Michael Hunger

unread,
Oct 23, 2012, 5:16:43 PM10/23/12
to ne...@googlegroups.com
If you look at the returned error message, it complains about using a reserved word ("start") as parameter name:

quote it with backticks, like

"query": "start r =  relationship({id}) set r.StartDate = {`start`}, r.EndDate = {end}, r.ModifiedBy = {user}, r.LastModified = {date} return r",


betseyb

unread,
Oct 23, 2012, 5:22:40 PM10/23/12
to ne...@googlegroups.com
Thanks!  <smacks forehead>
Reply all
Reply to author
Forward
0 new messages