apache / apache/pouchdb

Cannot sort on field(s) "name" when using the default index

Open
#9,068 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.6k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

It's impossible to find a sort because it claims that the defualt index is still active. Since I tried a lot of combinations (incl. only one property), I think this is a bug or a lack of docs.

```ts
await this.db.createIndex({
index: { fields: ['a', 'b'] }
});

const result = await this.db.find({
selector: { b: { $exists: false } },
sort: [{ a: 'desc' }]
});
```

> Cannot sort on field(s) "a" when using the default index

pouchdb: 9.0.0
pouchdb-find: 9.0.0

https://pouchdb.com/guides/mango-queries.html

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.