The simplest query executed inside my eventing function always returns empty results

I have a different eventing function scoped to a different bucket that works fine. Is there some permissions or configuration I need for the bucket? I’m using Enterprise Edition 7.1.1 build 3175

function OnUpdate(doc, meta) {
log(“Doc created/updated”,;
var results = select * from xxxx;

function OnDelete(meta, options) {
log(“Doc deleted/expired”,;

Do u have index on the bucket

execute same query in web console and check

Yes, both a primary index and an index on the

Yes, I have an index and yes the query works in the console.

You might have to iterate results actually send it to server before you log.