Restoring version number

I have a backup script which basically just dumps data as JSON and creates a corresponding bulk load script for that data.

I am starting to use (internal) version numbers in my app, so I looked at having my backup script restore the version number along with the id. But there doesn't seem to be a way to do this. I see I'd have to use index rather than create as the bulk operation, but _version there seems to behave like ?version=N on a replace, checking it not setting it. Is there any way to set the version to what it was before, so I can restore exactly what I originally had?

In one sense it doesn't matter that much, in that it just means version numbering will start over at 1 again for everything, and conflicts would still be detected. However, it doesn't feel right not to be able to restore the data as it was backed up.

Am I missing something?

external versioning will do this:

only index the document if the given version is strictly higher than the version of the stored document or if there is no existing document. The given version will be used as the new version and will be stored with the new document. The supplied version must be a non-negative long number.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.