Guest User

Untitled

a guest
Oct 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. cs.step(
  2. function getPageInfo() {
  3. var self = this;
  4. collection.find({}, {limit:10}).toArray(function(err, docs) {
  5. for (var i in docs) {
  6. tags = '';
  7. for (var j in docs[i].tags) {
  8. tags += docs[i].tags[j] + ' ';
  9. }
  10. outputHolder = { header : docs[i].header, content: docs[i].content, tags: tags };
  11. posts.push(outputHolder);
  12. }
  13. });
  14. },
  15. function getAllTags(err, data) {
  16. var self = this;
  17. collection.find({ tags: {$exists: true }}, {limit:10}).toArray(function(err, docs) {
  18. return(docs);
  19. });
  20. },
  21. function render(err, data1, data2) {
  22. // now I want everything from above
  23. console.log(data1);
  24. console.log(data2);
  25. /*res.render('index', {
  26. title: data.pageTitle,
  27. content: data.pageSubtitle,
  28. output: data.pageContent
  29. });*/
  30. }
  31. );
Add Comment
Please, Sign In to add comment