All Questions
119 questions
1 vote
0 answers
82 views
A crate makes use of a data type (i128) which is unsupported for serialization in the BSON spec. How to deal with this?
The issue My goal is to make an archive for Bluesky posts using MongoDB. I used atrium_api to interact with Bluesky's API. I received the posts in this FeedViewPost format, which is a type alias for ...
-1 votes
1 answer
26 views
Rust Mongodb generic collections: Can't find client.collection_with_type
I have been recently working on Rust with Mongodb to serialize/deserialize structures with a Mongodb collection. I found an article https://dev.to/techbelle/structuring-data-with-serde-in-rust-for-...
0 votes
1 answer
80 views
Rust mongodb duplicate key error handling [closed]
In my Rust application I need special handling of duplicate key (code 11000) errors. I figured out this solution, but it looks complicated. Is there any better way? let res = collection.insert_one(...
0 votes
1 answer
103 views
Problem compiling mongodb drivers with MinGW and MSYS2 on Windows 10
I'm compiling a project that uses mongodb driver. Now the program is not compiling because among the package dependencies one needs the reference to two libraries ...
-1 votes
1 answer
115 views
Rust with MongoDB sort by date latest
Here, I am using MongoDB to get the collections: let filter = doc! {}; let mut cursor = match collection.find(filter).await { Ok(cursor) => cursor, Err(e) => { eprintln!("...
1 vote
1 answer
224 views
Handling #[non_exhaustive] structs in Rust unit tests with MongoDB and Axum
I'm developing a Rust project using MongoDB. While writing unit tests, I encountered the #[non_exhaustive] attribute used in the MongoDB library. As I'm mocking UserRepository(mockall) which ...
0 votes
1 answer
126 views
How to use MongoDB driver in Rocket.rs?
I have simple rocket.rs app with register route Here it's service with mongodb sync driver pub async fn create_new_user(user_email: &str, password: &str, user_name: &str) -> Result<()...
0 votes
1 answer
356 views
Increasing shared memory results in increased response time - Performance Issue
As I mentioned below, the problem was occurring when using Rust + SQLX. I started implementing postgresql in a study project, but when I started testing it further I came across the first problem. ...
1 vote
0 answers
126 views
How to ensure High-Performance CSV to MongoDB Import with Rust: Tokio, Rayon or Alternative Strategies?
I am working on a high-performance data import task where I need to migrate billions of records from CSV files to a MongoDB database. Currently, I'm using Rust and considering the use of Tokio for ...
0 votes
0 answers
82 views
Mongodb does not finish query after many requests
I'm testing my application with gatling. The tested endpoint is the login, which must return user information. The function searches two collections sequentially, not in parallel. The problem occurs ...
1 vote
1 answer
105 views
$set field using another field with rust [duplicate]
how can I set one field using another field from the same document in MongoDb in Rust? I tried this, but it just sets "$another_price" literally as value let update = doc! { "...
0 votes
1 answer
146 views
How to write pipeline for collection.watch() in rust?
I have been creating some websocket method on my backend that will use ChangeStream to track data changes in my MongoDb collection. I have this code with a simple pipeline that tries to find records ...
0 votes
1 answer
209 views
Reading .bson file with Rust
I was very curious about .bson binary file produced by mongodump. At first, my guessing was BSON Array Bson::Array(array_of_documents) Then: #Cargo.toml [dependecies] ... bson = "2.1.0" //...
0 votes
1 answer
108 views
How to read which host of a MongoDB cluster answered my query (in Rust)?
I use MongoDB in a Rust application. I would like to know which server in the cluster send the response of a query. I can see the information (serverHost=) when I consume events with tracing crate but ...
0 votes
2 answers
323 views
Unable to use u128 datatype via MongoDB Rust driver: BsonSerialization(SerializationError { message: "u128 is not supported" })
I need help using Rust's u128 data type via MongoDB's Rust driver. Please find my minimal example below: use mongodb::{bson::{doc}, options::{ClientOptions, ServerApi, ServerApiVersion}, ...