ParamsOfQueryCollection.fromMap constructor

ParamsOfQueryCollection.fromMap(
  1. Map<String, dynamic> map
)

Implementation

ParamsOfQueryCollection.fromMap(Map<String, dynamic> map) {
  if (map.containsKey('collection') && (map['collection'] != null)) {
    _collection = map['collection'];
  } else {
    throw ('Wrong map data');
  }
  if (map.containsKey('filter')) {
    _filter = map['filter'];
  }
  if (map.containsKey('result') && (map['result'] != null)) {
    _result = map['result'];
  } else {
    throw ('Wrong map data');
  }
  if (map.containsKey('order')) {
    _order = [];
    for (var el in map['order']) {
      _order.add(OrderBy.fromMap(el));
    }
  }
  if (map.containsKey('limit')) {
    _limit = map['limit'];
  }
}