Skip to content

Commit

Permalink
example of looping over directory
Browse files Browse the repository at this point in the history
  • Loading branch information
extua committed Jun 18, 2024
1 parent fedd7ac commit 04aa7d1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions json_adder/examples/insert_many.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Example from https://www.mongodb.com/docs/drivers/rust/current/usage-examples/insertMany/

use std::fs;

// Loop over files in a directory, in this case I've created /data
fn main() {
for file in fs::read_dir("../../api.freifunk.net/data/history/").unwrap() {
println!("{}", file.unwrap().path().display());
}
}

0 comments on commit 04aa7d1

Please sign in to comment.