Error: Object does not support property or method "captureStackTrace"

You have a collection (=databse), use its name. Don’t use a data set if you want to use query. don’t use $w(“#”). Just put the collection name in the parentheses.