【问题标题】:PouchDB 400 bad requestPouchDB 400 错误请求
【发布时间】:2016-04-29 20:17:54
【问题描述】:

您好,您能帮忙确定一下这个 pouchDB 错误是什么意思吗?

谢谢

controller.js:

 pouchDBservice.addToExistingUser(userr._id, 'favoritePro', favPro);

services.js:

      addToExistingUser = function (docId, key, value) {
            //console.log(docId);
            usersDatabase
                .get(docId)
                .then(function (doc) {
                    doc[key] = value;
                    return usersDatabase.put(doc, docId, doc._rev);
                })
                .then(function () {
                    console.log('added field: ' + key + ' to doc ' + docId);
                })
                .catch(function (err) {
                    console.log("error from addToExistingUser:");
                    console.log(JSON.stringify(err));
                });

        };

我在控制台中收到此错误:

louisromain.cloudant.com/boardline_users/_bulk_get?revs=true&attachments=true&_nonce=1454421483935:1
POST https://louisromain.cloudant.com/boardline_users/_bulk_get?revs=true&attachments=true&_nonce=1454421483935
400 (Bad Request)

【问题讨论】:

    标签: angularjs ionic-framework pouchdb


    【解决方案1】:

    从 PouchDB 5.0.0 开始支持 _bulk_get,这是一个新的 CouchDB API,可以大大加快复制速度,将在 CouchDB 2.0 中首次亮相。请参阅 Nolan Lawson 的 this 博客文章。

    Cloudant 似乎没有提供_bulk_get 功能,所以上面的错误信息可以忽略。通常PouchDB除了这个错误外还会输出如下信息:

    400 以上是完全正常的。 PouchDB 只是检测 remote 支持 _bulk_get API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-21
      • 2018-04-07
      相关资源
      最近更新 更多