Skip to content

Mismatched types: expected RawDocumentBuf, found Document #1363

Closed
@clarkmcc

Description

@clarkmcc

Versions/Environment

  1. What version of Rust are you using? 1.78
  2. What operating system are you using? Ubuntu
  3. What versions of the driver and its dependencies are you using? (Run cargo pkgid mongodb & cargo pkgid bson) git+https://github.com/mongodb/mongo-rust-driver?branch=main#[email protected], git+https://github.com/mongodb/bson-rust?branch=main#[email protected]

Describe the bug

Compile error when I try to build the library

error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/f258c21/src/operation/bulk_write.rs:129:67
    |
129 | ...                   RunCommand::new(namespace.db.clone(), kill_cursors, None, None)?;
    |                       ---------------                       ^^^^^^^^^^^^ expected `RawDocumentBuf`, found `Document`
    |                       |
    |                       arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/runner/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/f258c21/src/operation/run_command.rs:22:19
    |
22  |     pub(crate) fn new(
    |                   ^^^
23  |         db: String,
24  |         command: RawDocumentBuf,
    |         -----------------------

error[E0277]: the `?` operator can only be applied to values that implement `Try`
   --> /home/runner/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/f258c21/src/operation/bulk_write.rs:129:29
    |
129 | ...                   RunCommand::new(namespace.db.clone(), kill_cursors, None, None)?;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `operation::run_command::RunCommand<'_>`
    |
    = help: the trait `Try` is not implemented for `operation::run_command::RunCommand<'_>`

BE SPECIFIC:

  • Did this issue arise out of nowhere, or after an update (of the driver,
    server, and/or Rust)? Started today, probably after main branch was modified.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions