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

Add unit test for Document::extend

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: bson-2.0.0-beta.2
    • Component/s: None
    • Labels:

      Description

      It would make sense to have functionality on Document similar to Vec::extend

      Issue originally filed by gembin on GitHub https://github.com/mongodb/bson-rust/issues/192

      let doc1 = doc!
      Unknown macro: { "field1"}
      let doc2 = doc!
      Unknown macro: { "field2"}
      Merged doc:

      let merged_doc = doc!
      Unknown macro: { "field1"}
      I know there is an API: doc1.insert("field2", "value2");
      I think it would be great if have an API like this: doc1.merge(doc2)

      Add a unit test to verify this functionality.

        Attachments

          Activity

            People

            Assignee:
            nathan.blinn Nathan Blinn (Inactive)
            Reporter:
            patrick.freed Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: