endBefore method Null safety

void endBefore(
  1. Map<String, dynamic> dataEntry
)

This method is used to set the end position of the data to be queried, and return to the data records with the corresponding records at the end position not included.

To ensure the query performance of endBefore(), you need to create the index required by the Cloud DB before calling this method to construct the query condition. If no index is created, you may receive an exception message. You need to create the missing index based on the exception message.

Implementation

void endBefore(Map<String, dynamic> dataEntry) {
  if (dataEntry.isEmpty) {
    throw FormatException('dataEntry cannot be empty.', dataEntry);
  }
  _queryElements.add(
    <String, dynamic>{
      _QueryConstants.OPERATION: _QueryConstants.END_BEFORE,
      _QueryConstants.ZONE_OBJECT_DATA_ENTRY: dataEntry,
    },
  );
}