PouchDB find() returns empty array after delete 1 of 6 objects from db

前端 未结 1 839
长发绾君心
长发绾君心 2021-01-20 07:16

Here is my db.find():

db.createIndex({
  index: {
    fields: [\'username\', \'date\'],
    name: \'usernameDateIndex\',
    ddoc: \"usernameDateIndex\"
  }
         


        
1条回答
  •  独厮守ぢ
    2021-01-20 07:51

    Take a loot at this answer, according to item 2 of the answer:

    1. At query time, an index can only be used if all it's indexed fields are required to exist according to the selector. For example, if your index contains fields A and B but you only query for A, we can't use the index because it won't include documents that contain A but not B.

    Maybe that's the cause of your issue.

    0 讨论(0)
提交回复
热议问题