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

Function throwReadPreferenceError

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

Source from the content-addressed store, hash-verified

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

Callers 1

resolveOptsConflictsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected