pouchdb-find: Can't find any docs after deleting one

41 views
Skip to first unread message

Juan Huttemann

unread,
Jun 25, 2020, 3:20:14 AM6/25/20
to PouchDB
I can find perfectly any doc until I delete one of them, after that db.find just return an empty array []

My index:

db.createIndex({
 index
: {
 fields
: ['name'],
 
},
})


My find code:

db.find({
 selector
: {
 name
: {$regex: RegExp(query, 'i')},
 
},
 sort
: ['name'],

})

How I delete docs:
db.get(id)
 
.then(function(doc) {
 doc
._deleted = true;
 
return db.put(doc);
})



Garren Smith

unread,
Jun 25, 2020, 3:27:12 AM6/25/20
to PouchDB
Hi Juan, what version of PouchDB?

Have you tried without creating an index?

cheers
garren

--
You received this message because you are subscribed to the Google Groups "PouchDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pouchdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pouchdb/f3f00070-0dac-4ba8-8d6e-327e126eecdbo%40googlegroups.com.

juanfhu...@gmail.com

unread,
Jun 25, 2020, 10:16:22 AM6/25/20
to PouchDB
I'm using version 7.2.1 

Worked without creating an index, and removing sort in find method.

Thank you so much!

Reply all
Reply to author
Forward
0 new messages