[Groonga-commit] droonga/express-droonga at 35e391d [master] Support simple string as a value of group_by[key][attributes] for the REST API of the search command

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed May 28 12:36:00 JST 2014


YUKI Hiroshi	2014-05-28 12:36:00 +0900 (Wed, 28 May 2014)

  New Revision: 35e391dede9faf8edbf4d2d171a23a5cd3038dcb
  https://github.com/droonga/express-droonga/commit/35e391dede9faf8edbf4d2d171a23a5cd3038dcb

  Message:
    Support simple string as a value of group_by[key][attributes] for the REST API of the search command

  Modified files:
    lib/adapter/api/rest-request-builder.js

  Modified: lib/adapter/api/rest-request-builder.js (+5 -1)
===================================================================
--- lib/adapter/api/rest-request-builder.js    2014-05-15 10:00:02 +0900 (a18be3d)
+++ lib/adapter/api/rest-request-builder.js    2014-05-28 12:36:00 +0900 (486736f)
@@ -127,8 +127,11 @@ function buildGroupByQuery(sourceQueryName, params) {
 
   if ('attributes' in params) {
     var requestAttributes = params.attributes;
-    var keys = Object.keys(requestAttributes);
     var attributes = [];
+    if (typeof requestAttributes == 'string') {
+      attributes = requestAttributes.split(/\s*,\s*/);
+    } else {
+    var keys = Object.keys(requestAttributes);
     keys.forEach(function(key) {
       var requestAttribute = requestAttributes[key];
       var attribute = {
@@ -139,6 +142,7 @@ function buildGroupByQuery(sourceQueryName, params) {
         attribute.attributes = requestAttribute.attributes;
       attributes.push(attribute);
     });
+    }
     query.output.attributes = attributes;
   }
 
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index