WriteModel constructor

WriteModel({
  1. InsertOneModel? insertOneModel,
  2. DeleteOneModel? deleteOneModel,
  3. ReplaceOneModel? replaceOneModel,
  4. UpdateOneModel? updateOneModel,
  5. DeleteManyModel? deleteManyModel,
  6. UpdateManyModel? updateManyModel,
})

Implementation

factory WriteModel({
  InsertOneModel? insertOneModel,
  DeleteOneModel? deleteOneModel,
  ReplaceOneModel? replaceOneModel,
  UpdateOneModel? updateOneModel,
  DeleteManyModel? deleteManyModel,
  UpdateManyModel? updateManyModel,
}) {
  final _result = create();
  if (insertOneModel != null) {
    _result.insertOneModel = insertOneModel;
  }
  if (deleteOneModel != null) {
    _result.deleteOneModel = deleteOneModel;
  }
  if (replaceOneModel != null) {
    _result.replaceOneModel = replaceOneModel;
  }
  if (updateOneModel != null) {
    _result.updateOneModel = updateOneModel;
  }
  if (deleteManyModel != null) {
    _result.deleteManyModel = deleteManyModel;
  }
  if (updateManyModel != null) {
    _result.updateManyModel = updateManyModel;
  }
  return _result;
}