couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mclean, Adam" <>
Subject Views with include_docs=true including old or incomplete results.
Date Thu, 31 Oct 2013 13:09:58 GMT
I have a busy database that I'm querying with a view like "_design/[doc]/_view/[view]?include_docs=true"

I'm having trouble with old or incomplete documents being included in the result.

I see that either:
a) include_docs is including the previous version of the document - a version of the document
that wouldn't actually match the view.
b) include_docs is not including the document.  It includes the 'key', and 'value', but the
'doc' is empty in output.

This only occurs if I'm querying the view at roughly the same time (within a few ms) of the
incorrectly included document being written.  The document being written/updated DOES match
the view criteria, however the include_docs seems to have a timing issue where it retrieves
an old copy of the document, or doesn't include anything in the "doc": {} portion of the result.

So in summary I think the view logic is fine, but include_docs seems to retrieve incorrect
documents when the timing lines up.

I'm using CouchDB 1.3.1 with ERL R15B02 and Spidermonkey 1.8.5 on Linux.

Is this a caveat of using include_docs?  Would I be smarter to get the keys, then make a second
query to couch to get the documents?  Was this something 'known' in 1.3.1 and fixed in 1.4?



This email may be privileged and/or confidential, and the
sender does not waive any related rights and obligations.
Any distribution, use or copying of this email or the
information it contains by other than an intended recipient
is unauthorized. If you received this email in error,
please advise the sender (by return email or otherwise)
immediately. You have consented to receive the attached
electronically at the above-noted email address; please retain a
copy of this confirmation for future reference.

Ce courriel est confidentiel et protégé. L'expéditeur ne renonce
pas aux droits et obligations qui s'y rapportent. Toute diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il
contient par une personne autre que le (les) destinataire(s)
désigné(s) est interdite. Si vous recevez ce courriel par erreur,
veuillez en aviser l'expéditeur immédiatement, par retour de courriel
ou par un autre moyen. Vous avez accepté de recevoir le(s) document(s)
ci-joint(s) par voie électronique à l'adresse courriel indiquée ci-dessus;
veuillez conserver une copie de cette confirmation pour les fins de reference future.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message