MCPcopy Create free account
hub / github.com/Automattic/mongoose / throwReadPreferenceError

Function throwReadPreferenceError

lib/helpers/processConnectionOptions.js:61–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61function throwReadPreferenceError() {
62 throw new MongooseError(
63 'MongoDB prohibits index creation on connections that read from ' +
64 'non-primary replicas. Connections that set "readPreference" to "secondary" or ' +
65 '"secondaryPreferred" may not opt-in to the following connection options: ' +
66 'autoCreate, autoIndex'
67 );
68}
69
70module.exports = processConnectionOptions;

Callers 1

resolveOptsConflictsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected