Code Monkey home page Code Monkey logo

Comments (2)

DerZwergGimli avatar DerZwergGimli commented on June 12, 2024

ok i think i found my issue

 match collection
        .find_one(doc! { "_id": bson::oid::ObjectId::parse_str(&id).unwrap()  }, None)
        .await
    {
      [...]
    }

is this the correct way now? Are we supposed to use bson?
If yes this issue can be closed!
Thanks

from mongo-rust-driver.

patrickfreed avatar patrickfreed commented on June 12, 2024

Yep, ObjectId::parse_str is the correct way to create an ObjectId from a string in bson 2.0+. In 1.0 it used to be ObjectId::with_uri_str but was renamed to more closely match the API of the uuid crate.

from mongo-rust-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.