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

find_one_and_update fails with $set

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.9.1
    • Affects Version/s: 0.9.0-alpha
    • Component/s: None
    • Labels:

      Hello,

       

      I have the following code 

       

      let coll = conn.collection("collection");
      
      let filter = doc! { "_id": id };
      let update = doc! { "$set": {"meta": meta_data, "players": players } };
      match coll.find_one_and_update(filter, update, None) {
          Ok(_result) => (),
          Err(e) => println!("Mongodb error: {:?}", e),
      }
      
      ===> Mongodb error: Error { kind: CommandError(CommandError { code: 9, code_name: "FailedToParse", message: "Either an update or remove=true must be specified", labels: [] }) }
      

      It seems like it fails to pass the update property to findAndModify? Or am i doing something incorrect? Worked on the previous prototype driver.

       

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            m@martinelvar.dk Martin Jensen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: