I have this code here:
pub struct Account {
#[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
pub id: Option<ObjectId>,
pub email: String,
}
And I want to change "ObjectId" to String so I can use Ulid.
I have this code here:
pub struct Account {
#[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
pub id: Option<ObjectId>,
pub email: String,
}
And I want to change "ObjectId" to String so I can use Ulid.
2
Answers
If you need String use
check this it worked for me using MongoDB crate but you can give it a try Solution