Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-622

Add square bracket indexing to Document

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-2.14.0
    • Affects Version/s: None
    • Component/s: BSON
    • Not Needed

      By implementing the Index trait on Document, users can use square brackets to retrieve values like a Python dictionary. This is a familiar syntax from other BSON libraries and may be easier to read than the various getters we provide currently.
      e.g.

      let d = doc! { "x": 1 };
      let value: Option<&Bson> = d["x"];
      

       

            Assignee:
            jada.lilleboe@mongodb.com Jada Lilleboe
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: