Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ChatModel.getAll = function(callback) {
var statement = "SELECT id, message, createdOn " +
"FROM `" + config.couchbase.bucket + "` ORDER BY createdOn ASC";
var query = N1qlQuery.fromString(statement).consistency(N1qlQuery.Consistency.REQUEST_PLUS);
db.query(query, function(error, result) {
if(error) {
return callback(error, null);
}
callback(null, result);
});
};