Created
October 6, 2014 22:32
-
-
Save jpotts/5b6f0a7e05c96d1188a3 to your computer and use it in GitHub Desktop.
Fetching all content of a certain type using Gitana for CloudCMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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