Platforms to show: All Mac Windows Linux Cross-Platform

/MongoDB/MongoDB Watch Changes


You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MongoDB/MongoDB Watch Changes

This example is the version from Mon, 15th Oct 2023.

Project "MongoDB Watch Changes.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Function UnhandledException(error As RuntimeException) As Boolean Dim name As String = Introspection.GetType(error).name MessageBox name+": "+error.message Return true End EventHandler
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub Change() Dim ListIndex As Integer = Me.ListIndex If ListIndex = -1 Then Detail.Text = "" Else Dim json As String = List.Cell(ListIndex, 1) Detail.Text = json End If End EventHandler
End Control
Control Detail Inherits TextArea
ControlInstance Detail Inherits TextArea
End Control
Control MyTimer Inherits Timer
ControlInstance MyTimer Inherits Timer
EventHandler Sub Action() If ChangeStream <> Nil Then Dim json As String If ChangeStream.NextChange(json) Then dim d as new date List.AddRow d.SQLDateTime, json end If End If End EventHandler
End Control
EventHandler Sub Open() // open this server Dim u As New MongoURIMBS("mongodb://localhost/") client = New MongoClientMBS(u) // open this database Database = Client.Database("test") // now watch for changes ChangeStream = Database.Watch("{}") End EventHandler
Property ChangeStream As MongoChangeStreamMBS
Property Database As MongoDatabaseMBS
Property client As MongoClientMBS
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
MenuItem HelpMenu = "&Help"
End MenuBar
End Project

See also:

The items on this page are in the following plugins: MBS MongoDB Plugin.


The biggest plugin in space...