We use Cosmos DB to track all our devices and also data that is related to the device (and not stored in the device document itself) is stored in the same container with the same partition ID.

Both the device document and the related documents have `/deviceId` as the partition key. When a device is removed, then I remove the device document. I actually want to remove the entire partition, but this doesn't seem to be possible. So I revert to a query that queries for all items with this partition key and remove them from the database.

This works fine, but may consume a lot of RUs if there is a lot of related data (which may be true in some cases). I would rather just remove the device and schedule all related data for removal later (it doesn't hurt to have them in the database for a while). When RU utilization is low, then I start removing these items. Is there a standard solution to do this?

The best solution would be to schedule this and that Cosmos DB would process these commands when it has spare RUs, just like with the TTL deletion. Is this even possible?
['https://Stackoverflow.com/questions/67877783', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/956435/']
Dart is [null safe](https://dart.dev/null-safety/understanding-null-safety#uninitialized-variables) . You either must always assign a value or mark it explicitly as nullable using a `?` 

```
String _prenom = "Something";

```

or

```
String? _prenom;

```
in Dart class always add ? after DataType

```
bool? log = true;
String? mail;
String? password;
String? prenom;
String? nom;```

```