Get a copy of the array containing this value.
This value in binary form
Get a copy of the buffer containing this value.
This value in binary form
Returns a list of the changes represented by the delta with reference to a specified schema.
The schema supplied must comply with the data format of the delta. No validation takes place, so if the schema does not match the data then the results may be unpredictable.
the schema
the list of changes
Copy the binary data to a provided buffer.
the buffer to copy data to
the position in the target buffer at which data will be copied
Get the number of bytes
The length of the data in bytes
RecordV2 structural delta.
A RecordV2Delta describes the differences between two RecordV2 values. Unlike a binary delta, a structural delta can be queried to determine its effect. The RecordV2Delta.changes method provides details of which values have changed.
An instance can be created from two RecordV2 values using RecordV2.diff.
RecordV2Deltas are useful for identifying small changes to complex RecordV2 values. Here is an example of how to use this class to filter interesting changes from a value stream.
Example:
var datatype = diffusion.datatypes.recordv2(); session.addStream("topic", datatype).on('value', (path, spec, newValue, oldValue) => { var schema = datatype.parseSchema(spec.properties.SCHEMA); newValue.diff(oldValue).changes(schema).forEach((change) => { if (change.fieldName === "address") { // Do something with the changed address console.log(newValue.getFields()); } }); });
DiffusionData Limited
6.0
diffusion.datatypes.RecordV2.diff