How to use the couchbase.N1qlQuery.Consistency function in couchbase

To help you get started, we’ve selected a few couchbase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github couchbaselabs / cean-web-chat / models / chatmodel.js View on Github external
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);
    });
};