This commit is contained in:
Martin Donnelly 2016-03-21 16:40:15 +00:00
parent 200524443e
commit e5334cc5e7
2 changed files with 28 additions and 29 deletions

View File

@ -378,7 +378,7 @@ router.get('/entry/:id', function (req, res) {
});
router.get('/tags', function (req, res) {
logger.debug('entry..');
logger.debug('tag list..');
logger.debug(req.params.id);

View File

@ -7,51 +7,50 @@ keeper.insert(
{
"views": {
"taglist": {
"map": function (doc) {
if (doc.type == 1) {
emit(null, doc);
}
}
"map": function (doc) { if (doc.type == 1) { emit(null, doc); } }
}
}
}, '_design/taglist', function (error, response) {
console.log("_design/taglist added");
if (error) {
console.log(error);
} else
{
console.log("_design/taglist added");
}
});
keeper.insert(
{
"views": {
"getAllTags": {
"map": function (doc) {
if (doc.tags.list.length > 0) {
emit(null, doc.tags.list);
}
}
"map": function (doc) { if (doc.tags.list.length > 0) { emit(null, doc.tags.list); } }
}
}
}, '_design/getAllTags', function (error, response) {
console.log("_design/getAllTags added");
if (error) {
console.log(error);
} else
{
console.log("_design/getAllTags added");
}
});
keeper.insert(
{
"views": {
"getAllTags": {
"map": function (doc) {
if (doc.tags.list.length > 0) {
for (var t = 0; t < doc.tags.list.length; t++) {
emit(doc._id, [doc.tags.list[t], doc.title]);
}
}
}
"getTagByKey": {
"map": function (doc) { if (doc.tags.list.length > 0) { for (var t = 0; t < doc.tags.list.length; t++) { emit(doc._id, [doc.tags.list[t], doc.title]); } } }
}
}
}, '_design/getTagByKey', function (error, response) {
if (error) {
console.log(error);
} else
{
console.log("_design/getTagByKey added");
}
},
'_design/getTagByKey', function (error, response) {
console.log("_design/getTagByKey added");
}
)
;
});