setModel method

Future<void> setModel(
  1. String collectionId,
  2. AbsExModel model, {
  3. bool dontRealTime = false,
})

Implementation

Future<void> setModel(String collectionId, AbsExModel model, {bool dontRealTime = false}) async {
  try {
    await setData(collectionId, model.mid, model.toMap());
    // Delta 를 저장한다.
    if (!dontRealTime &&
        (collectionId.contains('_published') == false &&
            collectionId.contains('hycop_') == false)) {
      //print('setModel($collectionId, ${model.mid}, $dontRealTime)');
      HycopFactory.realtime?.setDelta(directive: 'set', mid: model.mid, delta: model.toMap());
    }
  } catch (e) {
    logger.severe("setModel(set) error", e);
    throw HycopException(message: "setModel(set) error", exception: e as Exception);
  }
}