thedodd / wither

An ODM for MongoDB built on the official MongoDB Rust driver.
https://docs.rs/wither
Other
324 stars 40 forks source link

Mongodb _id Serialized to Id #97

Open rishat5081 opened 1 year ago

rishat5081 commented 1 year ago

I have serialized the _id with the following data but the results are different, serializer update the _id to the Id

_id: '636a92a97624f9a6eef53a74', fullName: 'Hammas', email: 'hammas@gmail.com', avatar: 'https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/153.jpg', geoLocation: { type: 'Point', coordinates: [ 58.09623660121784, -88.42758967021332 ], _id: new ObjectId("636a92a97624f9a6eef53a76") }, isNewProfile: false }

here is the following response i am getting after serializer

"attributes": { "fullName": "Hammas", "email": "hammas@gmail.com", "isNewProfile": false, "geoLocation": { "type": "Point", "coordinates": [ 58.09623660121784, -88.42758967021332 ], "_id": "636a92a97624f9a6eef53a76" }, "avatar": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/153.jpg", "Id": "636a92a97624f9a6eef53a74"