mongodb / mongo-rust-driver

The official MongoDB Rust Driver
https://www.mongodb.com/docs/drivers/rust/current/
Apache License 2.0
1.44k stars 164 forks source link

Better way to populate a field in mongodb rust #1194

Closed ChanManChan closed 2 months ago

ChanManChan commented 2 months ago

I know we can populate a field using aggregate functions "$lookup" feature but is there a better and easy way to just populate a single field like in mongoose library for nodejs?

isabelatkinson commented 2 months ago

Hi @ChanManChan, the driver does not have any equivalent API to the populate functionality in mongoose; you'll need to call the aggregate method with a $lookup stage to do something similar in the driver.

ChanManChan commented 2 months ago

Thanks for the help.