bulk_get should not require rev property for each doc #4530

Closed
willholley opened this Issue Nov 2, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@willholley
Member

willholley commented Nov 2, 2015

In the CouchDB / CSG implementation, rev is an optional parameter for each document (e.g. from the example at apache/couchdb-chttpd#33):

{"docs": [{"id": "good-doc"}]}

should return :

{
    "results": [
    {
        "docs": [
            {
                "ok": {
                    "_id": "good-doc",
                    "_rev": "1-967a00dff5e02add41819138abb3284d",
                    "_revisions": {
                        "ids": [
                            "967a00dff5e02add41819138abb3284d"
                        ],
                        "start": 1
                    }
                }
            }
        ]
    }

However, in PouchDB / IndexedDB, this currently results in an error:

 {
    "results": [
    {
        "docs": [
            {
                "error": {
                    "error": true,
                    "message": "Invalid rev format",
                    "name": "bad_request",
                    "status": 400
                }
            }
        ]
    }

@daleharvey daleharvey added the bug label Nov 14, 2015

@nolanlawson

This comment has been minimized.

Show comment
Hide comment
@nolanlawson

nolanlawson Nov 20, 2015

Member

Yeah, that's weird. I thought we had that working; it should basically just do a post() for each one.

Member

nolanlawson commented Nov 20, 2015

Yeah, that's weird. I thought we had that working; it should basically just do a post() for each one.

willholley added a commit that referenced this issue Nov 25, 2015

(#4530) - Add basic tests for bulk_get tests
Add tests for bulk_get. Also fixes a couple of issues with the
documentation.

willholley added a commit that referenced this issue Nov 26, 2015

(#4530) - allow bulkGet requests without an explicit rev
If no revision is specified for a document when using the bulkGet API,
fetch the implicit winning revision. Rather than making an additional
request to fetch the rev, we depend on the implicit behaviour of db.get
without an open_revs parameter.

willholley added a commit that referenced this issue Nov 27, 2015

(#4530) - allow bulkGet requests without an explicit rev
If no revision is specified for a document when using the bulkGet API,
fetch the implicit winning revision. Rather than making an additional
request to fetch the rev, we depend on the implicit behaviour of db.get
without an open_revs parameter.

This commit also fixes a couple of documentation issues discovered
whilst writing the tests.

willholley added a commit that referenced this issue Dec 1, 2015

(#4530) - allow bulkGet requests without an explicit rev
If no revision is specified for a document when using the bulkGet API,
fetch the implicit winning revision. Rather than making an additional
request to fetch the rev, we depend on the implicit behaviour of db.get
without an open_revs parameter.

This commit also fixes a couple of documentation issues discovered
whilst writing the tests.
@daleharvey

This comment has been minimized.

Show comment
Hide comment
@daleharvey

daleharvey Dec 1, 2015

Member

Fixed in aea279a

Member

daleharvey commented Dec 1, 2015

Fixed in aea279a

@daleharvey daleharvey closed this Dec 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment