We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
data-bearing
ServerDescription
1 parent 5c8bf32 commit 852e14fCopy full SHA for 852e14f
lib/core/sdam/server_description.js
@@ -19,6 +19,13 @@ const WRITABLE_SERVER_TYPES = new Set([
19
ServerType.Mongos
20
]);
21
22
+const DATA_BEARING_SERVER_TYPES = new Set([
23
+ ServerType.RSPrimary,
24
+ ServerType.RSSecondary,
25
+ ServerType.Mongos,
26
+ ServerType.Standalone
27
+]);
28
+
29
const ISMASTER_FIELDS = [
30
'minWireVersion',
31
'maxWireVersion',
@@ -99,6 +106,13 @@ class ServerDescription {
99
106
return this.type === ServerType.RSSecondary || this.isWritable;
100
107
}
101
108
109
+ /**
110
+ * @return {Boolean} Is this server data bearing
111
+ */
112
+ get isDataBearing() {
113
+ return DATA_BEARING_SERVER_TYPES.has(this.type);
114
+ }
115
102
116
/**
103
117
* @return {Boolean} Is this server available for writes
104
118
*/
0 commit comments