1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Export module for streaming data export operations
//!
//! This module provides a comprehensive export system that supports:
//! - Streaming exports to avoid memory issues with large datasets
//! - Multiple query types (Find, Aggregate, etc.)
//! - Progress tracking with real-time feedback
//! - Multiple output formats (JSON Lines, CSV)
//!
//! # Architecture
//!
//! The export system is built on three main components:
//!
//! 1. **StreamingQuery**: Abstracts different query types into a unified streaming interface
//! 2. **ProgressTracker**: Provides real-time progress feedback to users
//! 3. **FormatWriter**: Handles writing documents to different file formats
//!
//! These components are orchestrated by the **ExportCoordinator**, which manages
//! the entire export pipeline.
//!
//! # Example
//!
//! ```no_run
//! // Example usage (requires MongoDB connection)
//! // This shows the general pattern for using the export system
//!
//! // 1. Create a cursor from a MongoDB query
//! // let cursor = collection.find(filter).await?;
//!
//! // 2. Create a streaming query
//! // let query = Box::new(CursorStreamingQuery::new(cursor, 1000, "Find"));
//!
//! // 3. Create progress tracker
//! // let tracker = ProgressTracker::new(None, true);
//!
//! // 4. Create format writer (async)
//! // let writer = Box::new(JsonLWriter::new("output.jsonl").await?);
//!
//! // 5. Create coordinator and execute
//! // let mut coordinator = ExportCoordinator::new(query, tracker, writer);
//! // let result = coordinator.execute().await?;
//! ```
pub use ExportCoordinator;
pub use ProgressTracker;
pub use StreamingQuery;
pub use ;