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

show_record_id filter not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The show_record_id filter does not seem to do anything.

      use mongodb::bson::doc;
      use mongodb::sync::Client;
       
      fn main() {
          let client = Client::with_uri_str("mongodb://localhost:27017").unwrap();
          let db = client.database("test");
       
          db.collection("test")
              .insert_one(doc! {"msg": "hi"}, None)
              .unwrap();
       
          let find_opts = mongodb::options::FindOptions::builder()
              .show_record_id(false)
              .build();
       
          let cursor = db.collection("test").find(None, find_opts).unwrap();
       
          println!("{:#?}", cursor.last());
      }
      

      output:

      Some(
          Ok(
              Document({"_id": ObjectId(ObjectId(5fa27b140040f3f40013ae1e)), "msg": String("hi")}),
          ),
      )
      

        Attachments

          Activity

            People

            Assignee:
            sam.rossi Samuel Rossi (Inactive)
            Reporter:
            neye@zhaw.ch Johannes Neyer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: