The below code works under http-functions.js and find a record that match the condition.
The same code does not find the record (given the same eq () argument).
The code is called following an event handler that was invoked in events.js .
wixData.query(“my_collection”, { suppressAuth: true } )
.eq(“deliveryId”, message)
.find()
.then((results) => {
if (results.items.length > 0) {
// found - when called from http-functions
} else {
// not found - when called for a js module that is imported by events.js
}
})
.catch((error) => {
console.error(Failed to query collection. ${error.message} ${error.code}
)
});