There’s a typo in the documentation:
In one of the examples the distinct() function is written as distict().
Maybe you’d like to forward it to the relevant people.
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#distinct
There’s a typo in the documentation:
In one of the examples the distinct() function is written as distict().
Maybe you’d like to forward it to the relevant people.
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#distinct
Excellent catch, J.D.
Wix/Corvid, here’s the complete code example that has the typo that J.D. refers to:
wixData.query("myCollection")
.eq("status", "active")
.gt("age", 25)
.distict("state")
.find()
.then( (results) => {
if (results.items.length > 0) {
let items = results.items;
let firstItem = items[0];
let totalCount = results.totalCount;
let pageSize = results.pageSize;
let currentPage = results.currentPage;
let totalPages = results.totalPages;
let hasNext = results.hasNext();
let hasPrev = results.hasPrev();
let length = results.length;
let query = results.query;
} else {
// handle case where no matching items found
}
} )
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
} );