     /// - throws: When we can't send the request/receive the response, you don't have sufficient permissions or an error occurred
     @discardableResult
     public func update(matching filter: Query, to updated: Document, upserting upsert: Bool = false, multiple multi: Bool = false, stoppingOnError ordered: Bool? = nil) throws -> Int {
-        return try self.update([(filter: filter.queryDocument, to: updated, upserting: upsert, multiple: multi)], stoppingOnError: ordered)
+        return try self.update([(filter: filter, to: updated, upserting: upsert, multiple: multi)], stoppingOnError: ordered)
     }
     
     // Delete

    ///
    /// - returns: The amount of updated documents
    @discardableResult
    public func update(_ updates: [(filter: Document, to: Document, upserting: Bool, multiple: Bool)], stoppingOnError ordered: Bool? = nil) throws -> Int {
        let protocolVersion = database.server.serverData?.maxWireVersion ?? 0
        
        if protocolVersion >= 2 {

        let document = try firstDocument(in: try database.execute(command: command))
        
        guard document["ok"] == 1 else {
            throw MongoError.commandFailure(error: document)
        }
        
        return document["value"] ?? Null()
    }
    
    /// Returns all distinct values for a key in this collection. Allows filtering using query
