Explore Developer Center's New Chatbot! MongoDB AI Chatbot can be accessed at the top of your navigation to answer all your MongoDB questions.

Learn why MongoDB was selected as a leader in the 2024 Gartner® Magic Quadrant™
MongoDB Developer
Rust
plus
Sign in to follow topics
MongoDB Developer Center
chevron-right
Developer Topics
chevron-right
Languages
chevron-right
Rust
chevron-right

Using MongoDB With Rust Web Development Framework

Rachelle Palmer1 min read • Published Jun 11, 2022 • Updated Aug 29, 2024
MongoDBRust
Facebook Icontwitter iconlinkedin icon
Rate this article
star-empty
star-empty
star-empty
star-empty
star-empty
So, you've decided to write a Rust application with MongoDB, and you're wondering which of the top web development frameworks to use. Below, we give some suggestions and resources for how to:
  1. Use MongoDB with Actix and Rust.
  2. Use MongoDB with Rocket.rs and Rust.
The TLDR is that you can use any of the popular Rust frameworks with MongoDB, and we have code examples, tutorials, and other resources to guide you.

Building MongoDB Rust apps with Actix

Actix is a powerful and performant web framework for building Rust applications with MongoDB, with a long list of supported features.
You can find a working example of using MongoDB with Actix in the databases directory under Actix's github, but otherwise, if you're looking to build a REST API with Rust and MongoDB, using Actix along the way, this tutorial is one of the better ones we've seen.

Building MongoDB Rust apps with Rocket.rs

Prefer Rocket? Rocket is a fast, secure, and type safe framework that is low on boilerplate. It's easy to build Rust applications with MongoDB and Rocket. There's a tutorial on Medium we particularly like on building a REST API with Rust, MongoDB, and Rocket.

Facebook Icontwitter iconlinkedin icon
Rate this article
star-empty
star-empty
star-empty
star-empty
star-empty
Related
Article

How Prisma Introspects a Schema from a MongoDB Database


May 19, 2022 | 8 min read
Article

Structuring Data With Serde in Rust


Apr 23, 2024 | 5 min read
Code Example

Beginner Coding Project: Build a Blog Engine With Rust and MongoDB


Sep 11, 2024 | 0 min read
Quickstart

Getting Started with Aggregation Pipelines in Rust


Oct 01, 2024 | 15 min read