pouchdb: PouchDB query does not return doc with latest revision when Cloudant DB is recreated
PouchDB once synced with remote CloudantDb and the sequence went beyong 10K. Now due to unavoidable circumstances we flushed the remote Cloudant Db and recreated with the exact same doc but only thing all doc now have seq=1-xxxx Now any changes done on Cloudant does bring the updated document with seq=1 or 2 or smaller nos and Pouch DB shows multiple docs with seq=1-xxx (the newer doc) as well with seq=1-yyy (older replicated copy).
But the issue is when we query the PouchDB for any _id it returns the one with highest seq=10K something, and not the one iwht 1-xxx.
I’m using PouchDB v5.4.5 in hybrid Ionic App.
Issue persists on all browsers and I am using the WebSQL adapter, but think this would occur using any adapter
Response :
{"results":[
{"seq":"553-g1AAAAL0eJyl0ksOgjAQBuBGTdBTaIxrUoqUspKbaKctQYI14bHWm-hN9CZ6E2xloexQNjPJZPJN8mdyhNA0HUu0kiCOhYolEFcdSpHyoiox9lyRH2vJdeVqVeVme8QRzJumydIxRwczcCjFlHiRRLNaS5XstZK_ibAwFTYd1OeMcOYPQGOLbjsojrwkomQAurPoqYPCGtMwCP5H9cRUdDbNuJevXEXIEhYOha8tfPvAUcAEUG8ofG_hh4WdNxxwUMTm24v65-azvWnjBzNctr_i-4wp3FPLXsF06yg","id":"bases_769","changes":[{"rev":"1-ab82650daaf2d984945754be29c429c8"}]},
{"seq":"16-g1AAAALxeJyl0EsOgjAQBuBGTNBT6MI1KUXaspKbaF8ECZSEx1pvojfRm-hNsMBC2SFsZpLJ5PuTPwUArGJLgp3kIi9UKDlyVFaKmBVVCaHriDSvJdOVo1WVmu8FA3zTNE0SWwxk5mBjDDFyAwnWtZYqOmsl_xP51kx-GKAeo4hRbwYatuhxgMLAjQKMZqCnFr0MUL6HmPj-dFQvzQRXs4x7--lVEBpRMhe-9_DjCwc-FRy7c-FnD79a2O5gn3GF2n5HUVMy331mV_-6y0SCCMLISCr5ADvj62w","id":"users_152619","changes":[{"rev":"3-0b3e3ad87856f6c443881fa3172cdbf2"}]}
],
"last_seq":"16-g1AAAALxeJyl0EsOgjAQBuBGTNBT6MI1KUXaspKbaF8ECZSEx1pvojfRm-hNsMBC2SFsZpLJ5PuTPwUArGJLgp3kIi9UKDlyVFaKmBVVCaHriDSvJdOVo1WVmu8FA3zTNE0SWwxk5mBjDDFyAwnWtZYqOmsl_xP51kx-GKAeo4hRbwYatuhxgMLAjQKMZqCnFr0MUL6HmPj-dFQvzQRXs4x7--lVEBpRMhe-9_DjCwc-FRy7c-FnD79a2O5gn3GF2n5HUVMy331mV_-6y0SCCMLISCr5ADvj62w","pending":0}
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (11 by maintainers)
Then grab
packages/pouchdb/dist/pouchdb.js
; that’s the latest build. 😃