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 2018/01/09 10:28:19 UTC

[GitHub] chetanmeh opened a new issue #3161: Add type property to entity documents

chetanmeh opened a new issue #3161: Add type property to entity documents
URL: https://github.com/apache/incubator-openwhisk/issues/3161
 
 
   Currently all whisk entities are stored in "whisks" collection in couchdb. Most queries around these entities are of form [root namespace, date] invoked against entity specific views.
   
       GET /local_whisks/_design/whisks.v2/_view/packages?descending=true&endkey=["guest",0]&reduce=false&startkey=["guest","?","?"]&limit=30
       
   The views are computed by "inferring" the entity type [0] based on document properties.This mode of querying works fine with couchdb which provides "computed" views. However it poses problem with storage system where query relies on declarative indexes.
   
   As discussed on [mailing list][1] we should add a `type` property which is set to entity type.
   
   Would open a separate issue for namespace
   
   [0]
   ```
   var isPackage = function (doc) {
           return (doc.binding !== undefined)
    };
   var isAction = function (doc) {
        return (doc.exec !== undefined)
    };
    var isTrigger = function (doc) {
           return (doc.exec === undefined && doc.binding === undefined &&
   doc.parameters !== undefined)
    };
    var isRule = function (doc) {
           return (doc.trigger !== undefined)
    };
   ```
   
   [1]: https://lists.apache.org/thread.html/36891e1f3a37312e3923b90717599a4a8a5c8260aea66a0b0fc5f4db@%3Cdev.openwhisk.apache.org%3E

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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