1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

format markdown

This commit is contained in:
Rob Ede
2022-03-06 00:43:10 +00:00
parent f27cc4b6b4
commit e239414a55
31 changed files with 165 additions and 188 deletions

View File

@ -1,23 +1,16 @@
# MongoDB
Simple example of MongoDB usage with Actix Web. For more information on the MongoDB Rust driver,
visit the [documentation](https://docs.rs/mongodb/2.0.0/mongodb/index.html) and
[source code](https://github.com/mongodb/mongo-rust-driver).
Simple example of MongoDB usage with Actix Web. For more information on the MongoDB Rust driver, visit the [documentation](https://docs.rs/mongodb/2.0.0/mongodb/index.html) and [source code](https://github.com/mongodb/mongo-rust-driver).
## Usage
### Install MongoDB
Visit the [MongoDB Download Center](https://www.mongodb.com/try) for instructions on how to use
MongoDB Atlas or set up MongoDB locally.
Visit the [MongoDB Download Center](https://www.mongodb.com/try) for instructions on how to use MongoDB Atlas or set up MongoDB locally.
### Set an environment variable
The example code creates a client with the URI set by the `MONGODB_URI` environment variable. The
default URI for a standalone `mongod` running on localhost is "mongodb://localhost:27017". For more
information on MongoDB URIs, visit the
[connection string](https://docs.mongodb.com/manual/reference/connection-string/) entry in the
MongoDB manual.
The example code creates a client with the URI set by the `MONGODB_URI` environment variable. The default URI for a standalone `mongod` running on localhost is "mongodb://localhost:27017". For more information on MongoDB URIs, visit the [connection string](https://docs.mongodb.com/manual/reference/connection-string/) entry in the MongoDB manual.
### Run the example