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

Reduce helper boilerplate

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None

      Helper methods, especially when involving building options, have a fair bit of boilerplate currently. For example, compare

      client.database("db").create_collection("view", CreateCollectionOptions::builder().view_on("coll".to_string()).build())

      with doing the same this via run_command:

      client.database("db").run_command(doc!{ "create": "view", "viewOn": "coll" }, None)

      When we have the opportunity to revisit API structure in 3.0, we should see if we can find good ways to improve the ergonomics of this.

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            abraham.egnor@mongodb.com Abraham Egnor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: