Overview¶
The upsert
operation allows updating an existing object or inserting a new one into the data table. It uses the objectId
value to locate and update an existing object. If the operation cannot find an existing object, it inserts a new one into the data table with the specified objectId
value.
When an object is upserted in the Backendless Real-Time Database, it instantly notifies connected clients about the change using the upsert
event. Objects can be upserted either using the Backendless Data API or in Backendless Console. A listener for the upsert
event can be notified about either upserts of any object in the database or only those which match a pattern expressed as a where clause.
An event listener itself is an object which receives a callback when an event is triggered by the real-time database. To add an event listener, it is necessary to obtain a handler for a database table first. The handler provides methods for registering an event listener.