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: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:

      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:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: