Coverage for pyodmongo/models/responses.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-16 15:08 +0000

1from pydantic import BaseModel 

2from .id_model import Id 

3 

4 

5class DbResponse(BaseModel): 

6 """ 

7 A class representing the response from database operations. 

8 

9 Attributes: 

10 acknowledged (bool): Whether the operation was acknowledged by the server. 

11 deleted_count (int): The number of documents deleted. 

12 inserted_count (int): The number of documents inserted. 

13 matched_count (int): The number of documents matched by the query. 

14 modified_count (int): The number of documents modified. 

15 upserted_count (int): The number of documents upserted (inserted or replaced). 

16 upserted_ids (dict[int, Id]): A dictionary mapping index to the upserted document IDs. 

17 """ 

18 

19 acknowledged: bool 

20 deleted_count: int 

21 inserted_count: int 

22 matched_count: int 

23 modified_count: int 

24 upserted_count: int 

25 upserted_ids: dict[int, Id]