0

Is it possible to select and query JSON attribute names with spaces in them?

For example:

GET http://xyzz.com/appservices/xyzz/mycollection?ql=select data.sequences.Lifetime%20Referring%20Sources where data._id = 1234

Escaping with %20 in this case doesn't work. Oh, I should mention that I have little control of the attribute names without doing a huge amount transformation.

Here is a snippet of how the data is stored:

"data":{
   "_id":1234
   "sequences":{
      "Lifetime Referring Sources":1
   }
}
klevak
  • 63
  • 4

1 Answers1

0

I tried every combination I could think of (First\x%20Name, "First Name", 'First Name', First%20Name, and First\ Name. None of them worked so I think you are out of luck.

The JSON spec does not specifically forbid spaces in the attribute names but it's not considered good practice for exactly this kind of reason -- translating a label into a variable gets tricky when there are spaces in the label

Michael Bissell
  • 1,210
  • 1
  • 8
  • 14
  • select data.sequences.["Lifetime Referring Sources"] didn't work either. How likely is it that any modern JSON parser is going to be able to handle this? – klevak Aug 15 '14 at 19:39