---
name: "mongoc_topology_description_has_readable_server"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_topology_description_has_readable_server"
---

# mongoc\_topology\_description\_has\_readable\_server(3)

## SYNOPSIS

```
bool
mongoc_topology_description_has_readable_server (
  const mongoc_topology_description_t *td, const mongoc_read_prefs_t *prefs);
```

Determines if the topology has a readable server available. Servers are filtered by the given read preferences only if the driver is connected to a replica set, otherwise the read preferences are ignored. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O and it does not block.

## PARAMETERS

- •

  **td**: A *mongoc\_topology\_description\_t*.

- •

  **read\_prefs**: A *mongoc\_read\_prefs\_t* or **NULL** for default read preferences.

## RETURNS

True if there is a known server matching **prefs**.

**SEE ALSO:**

```
Introduction to Application Performance Monitoring
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
