Skip to content

Commit a0f0dbb

Browse files
author
Yaoxing
committed
* GridStore doesn't share readPreference setting from connection string. JIRA issue NODE-557
1 parent 0c628e9 commit a0f0dbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/gridfs/grid_store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ var GridStore = function GridStore(db, id, filename, mode, options) {
127127
// Set the root if overridden
128128
this.root = this.options['root'] == null ? GridStore.DEFAULT_ROOT_COLLECTION : this.options['root'];
129129
this.position = 0;
130-
this.readPreference = this.options.readPreference || ReadPreference.PRIMARY;
130+
this.readPreference = this.options.readPreference || db.options.readPreference || ReadPreference.PRIMARY;
131131
this.writeConcern = _getWriteConcern(db, this.options);
132132
// Set default chunk size
133133
this.internalChunkSize = this.options['chunkSize'] == null ? Chunk.DEFAULT_CHUNK_SIZE : this.options['chunkSize'];

0 commit comments

Comments
 (0)