connect_mongodb

Function connect_mongodb 

Source
pub async fn connect_mongodb(connection_string: &str) -> Result<Client>
Expand description

Connect to MongoDB database

Opens a connection to MongoDB using the provided connection string. The connection is read-only by default (enforced at application level).

§Arguments

  • connection_string - MongoDB connection URL (will be validated)

§Returns

MongoDB Client if successful

§Security

  • Connection string is validated before use
  • Application enforces read-only operations
  • No modifications possible through this interface

§Examples

let client = connect_mongodb("mongodb://localhost:27017/mydb").await?;
// Use client to read data