File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
source/includes/quick-start/code-snippets Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1- use mongodb:: { bson:: doc, Client , Collection } ;
2- use bson:: Document ;
1+ use mongodb:: {
2+ bson:: { Document , doc} ,
3+ Client ,
4+ Collection
5+ } ;
36
47#[ tokio:: main]
58async fn main ( ) -> mongodb:: error:: Result < ( ) > {
Original file line number Diff line number Diff line change 1- use mongodb:: { bson:: doc, sync:: { Client } } ;
2- use bson:: Document ;
1+ use mongodb:: {
2+ bson:: { Document , doc} ,
3+ sync:: { Client , Collection }
4+ } ;
35
46fn main ( ) -> mongodb:: error:: Result < ( ) > {
57 // Replace the placeholder with your Atlas connection string
@@ -10,7 +12,7 @@ fn main() -> mongodb::error::Result<()> {
1012
1113 // Get a handle on the movies collection
1214 let database = client. database ( "sample_mflix" ) ;
13- let my_coll = database. collection :: < Document > ( "movies" ) ;
15+ let my_coll: Collection < Document > = database. collection ( "movies" ) ;
1416
1517 // Find a movie based on the title value
1618 let my_movie = my_coll. find_one ( doc ! { "title" : "The Perils of Pauline" } , None ) ?;
You can’t perform that action at this time.
0 commit comments