Skip to content

Instantly share code, notes, and snippets.

@dungphanxuan
Last active February 26, 2016 04:50
Show Gist options
  • Save dungphanxuan/134d700ab8a45e0c939c to your computer and use it in GitHub Desktop.
Save dungphanxuan/134d700ab8a45e0c939c to your computer and use it in GitHub Desktop.
CouchBase Snippet

View example

 function (doc, meta) {
  emit([key], doc);
}

Query example

 $skip = 0;
        if($page >0){
            $skip = $limit*($page-1);
        }
$query = \CouchbaseViewQuery::from('article', 'index')
                ->range($from,$end)
                ->limit($limit)->skip($skip)
                ->custom([
                    'inclusive_end'=> 'true',
                    'full_set'=> 'true',
                    'descending'=> 'true'
                ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment