toParams abstract method

Future<Map<String, Object?>> toParams({
  1. Db? db,
})

Converts the model instance to a map of parameters for MongoDB operations.

The toParams method should be implemented by subclasses to define how the model is serialized into a map of key-value pairs suitable for database storage or updates.

The optional db parameter can be passed to provide the database context if needed for serialization.

Returns a Future containing a Map of key-value pairs representing the model.

Implementation

Future<Map<String, Object?>> toParams({Db? db});