You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/09/23 06:04:40 UTC

[GitHub] [openwhisk] chetanmeh commented on a change in pull request #4638: Remove legacy view code from subjects index.

chetanmeh commented on a change in pull request #4638: Remove legacy view code from subjects index.
URL: https://github.com/apache/openwhisk/pull/4638#discussion_r326956818
 
 

 ##########
 File path: ansible/files/auth_design_document_for_subjects_db_v2.0.0.json
 ##########
 @@ -0,0 +1,10 @@
+{
+  "_id": "_design/subjects.v2.0.0",
+  "views": {
+    "identities": {
+      "map": "function (doc) {\n  if (doc.namespaces && !doc.blocked) {\n    doc.namespaces.forEach(function(namespace) {\n      var v = {_id: namespace.name + '/limits', namespace: namespace.name, uuid: namespace.uuid, key: namespace.key};\n      emit([namespace.name], v);\n      emit([namespace.uuid, namespace.key], v);\n    });\n  }\n}"
+    }
+  },
+  "language": "javascript",
+  "indexes": {}
+}
 
 Review comment:
   FTR previous view was
   
   ```js
   function (doc) {
       if (doc.uuid && doc.key && !doc.blocked) {
           var v = {namespace: doc.subject, uuid: doc.uuid, key: doc.key};
           emit([doc.subject], v);
           emit([doc.uuid, doc.key], v);
       }
       if (doc.namespaces && !doc.blocked) {
           doc.namespaces.forEach(function (namespace) {
               var v = {
                   _id: namespace.name + '/limits',
                   namespace: namespace.name,
                   uuid: namespace.uuid,
                   key: namespace.key
               };
               emit([namespace.name], v);
               emit([namespace.uuid, namespace.key], v);
           });
       }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services