Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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