在使用 Skygear JS SDK 时,查询是否返回数组?
readDummy: function(){
const Test = skygear.Record.extend('test_test');
const Query = new skygear.Query(Test);
skygear.publicDB.query(Query).then((records) => {
console.log(records.constructor === Array); // return false
console.log(JSON.stringify(records[0])); //do display correctly
//{"_id":"test_test/b9633d1a-ff3c-491b-82f3-93c8cefb5313","_access":[{"public":true,"level":"read"}],"content":"Hello World"}
}, (error) => {
console.error(error);
});
},