Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

CBL does not invalidate existing INDEX on view update #95

Open
tjayesh opened this issue Jun 8, 2017 · 0 comments
Open

CBL does not invalidate existing INDEX on view update #95

tjayesh opened this issue Jun 8, 2017 · 0 comments
Labels

Comments

@tjayesh
Copy link

tjayesh commented Jun 8, 2017

I am trying modifying MAP and REDUCE function on application upgrade/update.
Client is able to update/modify VIEW with modified MAP and REDUCE functions and there's also change in revision on success. BUT existing view INDEX does not gets invalidated. Instead on querying view it returns same old data, however newly indexed data as per new map function.

The version parameter to setMapBlock takes a bit of explanation. During development, and as you update the app, you may change the behavior of a map function. This invalidates any existing index generated by that function, so the next time the app runs, the view should rebuild the index from scratch using the new function. Unfortunately the view indexer can't tell that the map function has changed because it can't see its source code! Instead, you have to provide a version string that the indexer can compare, and you must change that string whenever you change the function. The easiest thing to remember is just to set the version to "1" initially, and then increment it every time you edit any source code in the map function (or any function of yours that it calls.)

@djpongh djpongh added the icebox label Aug 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants