Fix bug in JsView

Fixed a bug that caused documents from unrelated storages to be
inserted into the view.