Reputation: 7092
I need to create a view with Couchdb but I dont want to use the current records, I want to use records of a specific revision. For example, lets imagine that I have an invoice with an array of products ids and theirs revision, I want to return the products with the description and prices as was at the invoice creation. Is it possible?
Upvotes: 0
Views: 33
Reputation: 2910
You can access revisions via the API like documented in the http document API So if you have a view that returns all the document Id's of the correct type you can access the documents directly by id and revision.
Whilst couchdb supports the use of revisions, I'd recommend not to rely on this for something as complex as invoicing, but instead just create new documents. I have a similar case where I have a report_id and a timestamp and a view that returns a key combination of the two elements so I can easily access the different versions of the report.
Upvotes: 1