Reputation: 1
I have a couple of questions surrounding the NotesView.update functionality.
I currently have a single Notes database on my domino server that pulls information from a few other databases via a sync agent into itself making it the primary data source for my DTG mobile app.
My Notes sync agent removes / hard deletes documents from my primary Notes Database that Domino To Go syncs with.
Are the documents in my DTG view on the device automatically removed too when they are no longer in the Server database during a NotesView.update or do they live on in the DTG view oblivious to the fact that their parent has been deleted?
The reason I ask is that I want to institute the syncModifiedOnly parameter and the documentation describes needing to add a $dtgIsRemoved column to the end of my Notes view to speed things up.
Also describes needing to add a formula to the column in order to make the DTG view understand that I want to remove the underlying DTG document.
Having said that, does that mean that:
I shouldn't be Removing the NotesDocuments in my sync agent or from the NotesDatabase.
Leave them in the Notes view and create a formula in the $dtgIsRemoved column that will return "1" if I want the DTG document removed during a NotesView.update?
Originally I thought that deleting a Notes Document on the server database would automatically remove the document from DTG during a NotesView.update without user intervention in the cleanupCallback.
A little unclear as to how the $dtgIsRemoved can help me speed up the update.
Ultimately I want to speed up my view.update.
I have 5 views that are coupled in callbacks and view.updates and displaying a progressbar.
Still though it is very inconsistent when run on my iOS device, total doc count is around 73000 and sometimes takes 60 seconds and other times 180 - 200.
Displaying the information is fast and searching lightning fast with SQL, it's just the NotesView.update that is an issue for me at this stage.
This is how I think it works: NotesView.update - runs through all entries in the DTG view for each doc in the DTG view,
check the $dtgIsRemoved column, if = "1", remove the doc from the DTG view
get the corresponding NotesDocument in the Parent NotesDatabase
if no handle then mark the DTG doc for deletion
otherwise check the syncModifiedOnly parameter
if set to true then look at the last sync date parameter
check the last modified date of the NotesDocument is >= last sync
if true then sync all fields / columns.
At end of sync, run the cleanup process to actually remove the docs that were tagged for deletion OR weren't found in the parent NotesDatabase.
Still failing to see the point of the $dtgIsRemoved column if the NotesView.update removes documents from the DTG view that aren't in the source database view. Removing them from the source view would happen in the Notes view selection formula or in a straight NotesDocument.Remove in a sync agent like mine.
Upvotes: 0
Views: 41
Reputation: 1114
Tamir,
I'm in a hurry right now but I want to give a quick answer right now:
Yes, documents in the app will be removed if they do not longer exist on the Domino side.
The $dtgisremoved column is optional, but can speed things up if used together with the syncModifiedOnly option, otherwise it has no effect.
SyncModifiedOnly gives a date to the DTG XPage which creates the JSON data, and the XPage only creates JSON data for documents that has been changed since this date. So this can speed up the sync greatly if only few documents change in a couple of days.
SyncModifiedOnly looks after the "modified" date of the Notes documents. But you can add a column (type datetime) in your Domino view which the SyncModifiedOnly logic should use. I believe the DTG option is syncModifedOnlyColumn - but I'm not sure right now.
If you use SyncModifiedOnly, but you don't have a $dtgisremoved column, the DTG XPage needs to put the UNID of EVERY document in the view in the JSON data in order to be able to detect which one has been deleted. That means a bigger JSON dataset, more data to transfer and more data to compute in the app. But if you hard delete the documents in the Domino database, you cannot create a $dtgisremoved column.
I hope this already helps!
Upvotes: 1