[Groonga-commit] droonga/express-droonga at f89bbc1 [master] Move attributes object into output object

Back to archive index

Yoji SHIDARA null+****@clear*****
Thu Aug 22 17:34:18 JST 2013


Yoji SHIDARA	2013-08-22 17:34:18 +0900 (Thu, 22 Aug 2013)

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

  Message:
    Move attributes object into output object

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

  Modified: lib/adapter/api/rest-request-builder.js (+5 -2)
===================================================================
--- lib/adapter/api/rest-request-builder.js    2013-08-22 17:31:07 +0900 (1cc2373)
+++ lib/adapter/api/rest-request-builder.js    2013-08-22 17:34:18 +0900 (dcac7b8)
@@ -35,8 +35,11 @@ function searchRequestBuilder(request) {
     }
   };
 
-  if (typeof queryParams.attributes == 'string')
-    queries.result.attributes = queryParams.attributes.split(',');
+  if (typeof queryParams.attributes == 'string') {
+    queries.result.output.attributes = queryParams.attributes.split(',');
+  } else {
+    queries.result.output.attributes = [];
+  }
   if (typeof queryParams.limit == 'string')
     queries.result.limit = getIntegerValue(queryParams, 'limit');
   if (typeof queryParams.match_escalation_threshold == 'string')

  Modified: test/adapter/rest.test.js (+2 -1)
===================================================================
--- test/adapter/rest.test.js    2013-08-22 17:31:07 +0900 (7b78d93)
+++ test/adapter/rest.test.js    2013-08-22 17:34:18 +0900 (0f46f89)
@@ -201,7 +201,8 @@ suite('HTTP Adapter', function() {
                 source: 'foo',
                 query:  'bar',
                 output: {
-                  elements: utils.allElements
+                  elements: utils.allElements,
+                  attributes: []
                 }
               }
             }

  Modified: test/rest-request-builder.test.js (+3 -2)
===================================================================
--- test/rest-request-builder.test.js    2013-08-22 17:31:07 +0900 (fbbafa7)
+++ test/rest-request-builder.test.js    2013-08-22 17:34:18 +0900 (d841b85)
@@ -21,7 +21,8 @@ suite('building message from REST adapter request', function() {
             source: 'test_table',
             query:  'foobar',
             output: {
-              elements: utils.allElements
+              elements: utils.allElements,
+              attributes: []
             }
           }
         }
@@ -55,8 +56,8 @@ suite('building message from REST adapter request', function() {
             limit:   100,
             matchTo: ['realname', 'nickname'],
             sortBy:  ['-realname', '-nickname'],
-            attributes: ['realname', 'nickname', 'age', 'job'],
             output: {
+              attributes: ['realname', 'nickname', 'age', 'job'],
               elements: utils.allElements
             }
           }
-------------- next part --------------
HTML����������������������������...
Download 



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