     /// For more information: https://docs.mongodb.com/manual/reference/command/collMod/#dbcmd.collMod
     ///
     /// You can use this method, for example, to change the validator on a collection:
-    ///    
+    ///
     ///     collection.modify(flags: ["validator": ["name": ["$type": "string"]]])
     ///
     /// - parameter flags: The modification you want to perform. See the MongoDB documentation for more information.

    /// - throws: When we can't send the request/receive the response, you don't have sufficient permissions or an error occurred
    ///
    /// - returns: The amount of matching `Document`s
    public func count(matching filter: Document? = nil, limitedTo limit: Int32? = nil, skipping skip: Int32? = nil) throws -> Int {
        var command: Document = ["count": self.name]
        
        if let filter = filter {
            command["query"] = filter
        }
        

        let document = try firstDocument(in: try database.execute(command: command))
        
        guard document["ok"] == 1 else {
            throw MongoError.commandFailure(error: document)
        }
    }
    
