Skip to content

Commit 48626cf

Browse files
committed
feat(data_mongodb): add pre-insertion document logging
This change enhances the diagnostic capabilities of the DataMongodb class by logging the document to be inserted right before executing the insertOne operation. This will help in debugging and verifying the data being sent to the database.
1 parent 6f915e3 commit 48626cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/src/data_mongodb.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ class DataMongodb<T> implements DataClient<T> {
288288
final doc = _prepareDocumentForInsertionOrUpdate(item);
289289
_logger.finer('Prepared document for insertion with _id: ${doc['_id']}');
290290

291+
// DIAGNOSTIC: Log the exact document before insertion.
292+
_logger.info('Executing insertOne with document: $doc');
293+
291294
final writeResult = await _collection.insertOne(doc);
292295

293296
if (!writeResult.isSuccess) {

0 commit comments

Comments
 (0)