Skip to content

Instantly share code, notes, and snippets.

@jpotts
Created October 6, 2014 22:32
Show Gist options
  • Save jpotts/5b6f0a7e05c96d1188a3 to your computer and use it in GitHub Desktop.
Save jpotts/5b6f0a7e05c96d1188a3 to your computer and use it in GitHub Desktop.
Fetching all content of a certain type using Gitana for CloudCMS
var Gitana = require('gitana');
var repoId = 'someRepoId';
conn = Gitana.connect({
}, function(err) {
if (err) console.log(err);
});
conn.readRepository(repoId).then(function () {
console.log('Repo: ' + this.title);
this.readBranch("master")
.queryNodes({
'_type': "custom:genericContent"
})
.each(function() {
console.log('id: ' + this._doc);
console.log('name: ' + this.name);
console.log('pageId: ' + this.pageId);
console.log('--------')
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment