metatables - need help parsing results from kii cloud

hi, I am trying to use kii to create a leaderboard. I must say kii is not Parse.com, nuff said. Anyway, I get the following returned when querying my ‘scores’ bucket and running the results through inspect.lua:

{

  queryDescription = “WHERE ( 1=1 )”,

  results = {

    <metatable> = {

      __jsontype = “array”

    }

  },

  <metatable> = {

    __jsontype = “object”

  }

I know the scores are in the results array…can someone help me dig through that metatable? I wish it was just straight-up json, no chaser … 

thanks,

Jen

With the help of Kii’s very nice Dev Evangelist, we figured it out. Basically I was receiving no data (so just an empty metatable) - I figured that this was happening by using json.encode(results) and seeing that results was returning [], an empty dataset. The trick is to do a Kii query against a ‘bucket’ of data, you need to avoid pagination (which is a confusing bit in their docs). 

I’ll probably write up a Kii tutorial once I get this sorted. I’d like to use their service to get my apps into the Asian markets.

best,

Jen

With the help of Kii’s very nice Dev Evangelist, we figured it out. Basically I was receiving no data (so just an empty metatable) - I figured that this was happening by using json.encode(results) and seeing that results was returning [], an empty dataset. The trick is to do a Kii query against a ‘bucket’ of data, you need to avoid pagination (which is a confusing bit in their docs). 

I’ll probably write up a Kii tutorial once I get this sorted. I’d like to use their service to get my apps into the Asian markets.

best,

Jen