Skip to content

key vs endkey #3977

@ronag

Description

@ronag

I believe that if key is provided, then endkey should be ignored? The docs seem to be unclear on this. However, the behavior I get is the opposite.

await couch.put('a', {})
await couch.put('b', {})
await couch.put('c', {})

const { rows } = await couch.allDocs({
  key: 'a',
  endkey: 'b'
})
console.log(rows)
test/index.js 2> [
test/index.js 2>   {
test/index.js 2>     id: 'a',
test/index.js 2>     key: 'a',
test/index.js 2>     value: { rev: '1-967a00dff5e02add41819138abb3284d' }
test/index.js 2>   },
test/index.js 2>   {
test/index.js 2>     id: 'b',
test/index.js 2>     key: 'b',
test/index.js 2>     value: { rev: '1-967a00dff5e02add41819138abb3284d' }
test/index.js 2>   }
test/index.js 2> ]

Looks like a bug?

couchdb:3.1.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions