Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ddoc = {
- _id: '_design/following',
- views: {
- [req.body.userName]: {
- map: function (doc) {
- for (var key in req.body.following) {
- eval(' if (' + req.body.following[key].userName + ' === req.body.userName) { ' +
- 'emit(doc.dateApproved);' +
- '} ')
- }
- }
- }
- }
- } ```
- I would like the output to look like this..
- var ddoc = {
- _id: '_design/index',
- views: {
- TerryFollower: {
- map: function(doc) {
- if (doc._id === "JohnFollowing") {
- emit(doc.dateApproved);
- }
- if (doc._id === "TimFollowing") {
- emit(doc.dateApproved);
- }
- if (doc._id === "DaveFollowing") {
- emit(doc.dateApproved);
- }
- }.toString()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement