You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2017/07/04 12:14:56 UTC

[couchdb-nano] branch feat/find updated (421e0fa -> 44772c6)

This is an automated email from the ASF dual-hosted git repository.

jan pushed a change to branch feat/find
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git.


    omit 421e0fa  feat: add _find
     new 44772c6  feat: add _find

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (421e0fa)
            \
             N -- N -- N   refs/heads/feat/find (44772c6)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tests/unit/design/find.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].

[couchdb-nano] 01/01: feat: add _find

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch feat/find
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git

commit 44772c65b692a87fc3744d05ac5cc6a3e7e679cd
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Tue Jul 4 14:12:34 2017 +0200

    feat: add _find
---
 lib/nano.js                              | 10 ++++++++++
 tests/helpers/unit.js                    |  2 --
 tests/integration/database/replicator.js | 10 +++++-----
 tests/unit/design/find.js                | 31 +++++++++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/lib/nano.js b/lib/nano.js
index 86ceba8..5610a60 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -752,6 +752,15 @@ module.exports = exports = nano = function dbScope(cfg) {
       }, callback);
     }
 
+    function find (selector, callback) {
+      return relax({
+        db: dbName,
+        path: '_find',
+        method: 'POST',
+        body: selector
+      }, callback);
+    }
+
     // db level exports
     docScope = {
       info: function(cb) {
@@ -796,6 +805,7 @@ module.exports = exports = nano = function dbScope(cfg) {
       search: viewSearch,
       spatial: viewSpatial,
       view: viewDocs,
+      find: find,
       viewWithList: viewWithList,
       server: serverScope,
       replication: {
diff --git a/tests/helpers/unit.js b/tests/helpers/unit.js
index bf9f21a..52cd7e6 100644
--- a/tests/helpers/unit.js
+++ b/tests/helpers/unit.js
@@ -93,7 +93,6 @@ helpers.unit = function(method, error) {
         assert.deepEqual(req, stub);
         assert.end();
       });
-
       f.apply(null, args);
     });
   };
@@ -109,7 +108,6 @@ function mockClient(code, path, extra) {
         if(error) {
           return cb(error);
         }
-
         if(code === 500) {
           cb(new Error('omg connection failed'));
         } else {
diff --git a/tests/integration/database/replicator.js b/tests/integration/database/replicator.js
index be77071..a5f8e15 100644
--- a/tests/integration/database/replicator.js
+++ b/tests/integration/database/replicator.js
@@ -52,10 +52,10 @@ it('should be able to replicate (replicator) three docs', function(assert) {
               assert.true(disabled, 'should not be null');
               assert.true(disabled.ok, 'should have stopped the replication');
               assert.end();
-            });  
+            });
           })
         })
-      }, 
+      },
       3000)
     };
     waitForReplication();
@@ -84,7 +84,7 @@ it('should be able to replicate (replicator) to a `nano` object', function(asser
             });
           });
         })
-      }, 
+      },
       3000)
     };
     waitForReplication();
@@ -111,9 +111,9 @@ it('should be able to replicate (replicator) with params', function(assert) {
               assert.true(disabled.ok, 'should have stopped the replication');
               assert.end();
             });
-          });  
+          });
         })
-      }, 
+      },
       3000)
     };
     waitForReplication();
diff --git a/tests/unit/design/find.js b/tests/unit/design/find.js
new file mode 100644
index 0000000..41a4026
--- /dev/null
+++ b/tests/unit/design/find.js
@@ -0,0 +1,31 @@
+// Licensed under the Apache License, Version 2.0 (the 'License'); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+'use strict';
+var findDesign = require('../../helpers/unit').unit([
+  'find',
+  'find'
+]);
+
+findDesign({
+  selector: {
+    name: 'foobar'
+  }
+}, {
+  body: '{"selector":{"name":"foobar"}}',
+  headers: {
+    accept: 'application/json',
+    'content-type': 'application/json'
+  },
+  method: 'POST',
+  uri: '/mock/_find'
+});

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.