Hi,
Are we now required to call getTotalCountI() and pass its return value to getItems()? I had the following code which was working up until recently:
Note in the snippet below and <sort_col> are strings specific to my database collection
and the dataset being queried has 10 records.
$w(‘’).setSort(wixData.sort().ascending(‘<sort_col>’));
return $w().getItems(0, 100) // Number of items was hard-coded to 100
.then((data) => {
for (let i = 0; i < data.totalCount; i++) {
// This used to work until Saturday Feb 10; item would be of type Object and could be accessed
// On Sun Feb 11 item became undefined and could not access its properties
let item = data.items[i]; // item is now undefined
I had to modify my code as follows:
$w(‘’).setSort(wixData.sort().ascending(‘<sort_col>’));
const totalItems = $w(.getTotalCount();
return $w().getItems(0, totalItems)
.then((data) => {
for (let i = 0; i < data.totalCount; i++) {
let item = data.items[i]; // item is now defined and type Object and is working correctly again
I also see the Database Collections toolbar now has import and export to CSV capabilities - awesome!