After succesful connection by Wix adapter to external database (Google Cloud / postgres) found that following code, using .aggregate resulting error “Error: WDE0116: fields don’t exist”.
Same time - .find() working.
All permissions on Cloud side given.
Several attempts (later with Wix Chat Bot) to change external collections / names / field types etc - same error (if collection / fields name correct)
export function aggregate() {
console.log(“Running aggregate()”);
wixData.aggregate("Accounting/ssd_ready_production")
.count()
.run()
.then((results) => {
console.log("Aggregation results: ", results);
if (results.items.length > 0) {
console.log("Count: " + results.items[0]._count);
} else {
console.log("No items found.");
}
})
.catch((err) => {
console.log("Error: " + err.message);
console.log("Code: " + err.code);
});
}
External dataset:
“id”:“ssd_ready_production”,
“displayName”:“ssd_ready_production”,
“allowedOperations”:[
“get”,
“find”,
“count”,
“update”,
“insert”,
“remove”,
“bulkRemove”,
“bulkInsert”,
“bulkUpdate”
],
“allowedSchemaOperations”:[
“list”,
“listHeaders”,
“createCollection”,
“dropCollection”,
“addColumn”,
“removeColumn”,
“describeCollection”,
“findWithSort”,
“aggregate”,
“bulkDelete”,
“truncate”,
“updateImmediately”,
“deleteImmediately”,
“startWithCaseSensitive”,
“startWithCaseInsensitive”,
“projection”,
“findObject”,
“matches”,
“not”,
“include”,
“filterByEveryField”
],
fields