var Place=monaca.cloud.Collection("place");
varCriteria=Place.find('name=="Monaca", {propertyNames:["title", "body", limit:5});
Place.find(Criteria, "_createdAt DESC", {propertyNames:["title", "body", limit:5})
.done(function(result)
{
console.log('Total items found:'+result.totalItems);
console.log('Total items found:'+result.items[0].body);
})
.fail(function(err)
{
console.log("Err#"+err.code+":"+err.message);
})
});
I just wrote the monaca Docs code to fit my environment, but
I was able to get the totalItems, but I wrote
below them.
result.items[0].body will be undefind.
There are no errors, so I don't know what's wrong.
Do I have to write any other properties...
I can't do it myself, so I'm going to give you a prediction answer.<> Results is an array, so
console.log('Total items found:'+result.items[0].body);
console.log('Total items found:'+result[0].items[0].body);
I think you can get it by changing it to .
© 2023 OneMinuteCode. All rights reserved.