replaceByExample method

Future<int> replaceByExample(
  1. Map<String, dynamic> example,
  2. Map<String, dynamic> newValue,
  3. {bool waitForSync,
  4. int limit}
)

Implementation

Future<int> replaceByExample(
  Map<String, dynamic> example,
  Map<String, dynamic> newValue, {
  bool waitForSync,
  int limit,
}) async {
  final resp = await _connection.request(
    method: 'PUT',
    path: '/_api/simple/replace-by-example',
    body: {
      if (waitForSync != null) 'waitForSync': waitForSync,
      if (limit != null) 'limit': limit,
      'example': example,
      'newValue': newValue,
      'collection': name,
    },
  );
  return resp.body['replaced'];
}