Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
El método de búsqueda de PouchDB no devuelve documentos

en paralelo con la replicación, ejecuto la consulta de búsqueda. Pero cuando la página se carga por primera vez, el método devuelve 0 documentos. si vuelve a cargar la página después de unos 5 segundos, el método devuelve todos los documentos

 public createIndex = async (): Promise<unknown> => { try { return await this.database.createIndex({ index: { fields: ['title'] } }); } catch (e) { ErrorHandler.processError(e); return null; } }; public find = async ( userId: string, ): Promise<any> => { try { return await this.database.find({ selector: { $or: [ {author: userId}, {writers: {$regex: userId}}, {readers: {$regex: userId}}, ], $and: [ {title: {$gt: null}} ], $not: [ {_delete: true} ], }, sort: [{title: "asc"}], fields: ["_id", "_rev", "id", "title", "created", "modified", "sharedUI", "author", "writers", "readers", "preview"], }) } catch (e) { ErrorHandler.processError(e); return null; } };
 React.useEffect(() => { const storage = new Database('schemes', {username: 'username', password: 'username'}); storage.createIndex().then(() => { storage.find(userId).then((resFind) => { console.log('resFind', resFind) }) }) }, [userId]);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!