buildCommand method

  1. @override
String buildCommand()
override

Build the @ command to be sent to remote secondary for execution.

Implementation

@override
String buildCommand() {
  StringBuffer serverCommandBuffer = StringBuffer('sync:');
  if (isPaginated) {
    serverCommandBuffer.write('from:');
  }
  serverCommandBuffer.write('$commitId');
  if (isPaginated) {
    serverCommandBuffer.write(':limit:$limit');
  }
  if (regex != null && regex!.isNotEmpty) {
    serverCommandBuffer.write(':$regex');
  }
  return (serverCommandBuffer..write('\n')).toString();
}