Skip to content

What are the consequences of using autoCreate and autoIndex? #5545

Answered by DanRibbens
hdodov asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @hdodov,

I appreciate the detailed explanation on the steps you took and problems you were facing. I'll share my knowledge and hopefully shed some light.

Add the readPreference option to the connection string

I haven't tested this but I think there is a difference in how documentDB and mongoDB replicasets are handling traffic. I agree with you on setting the readPreference. You could also experiment with the writeConcern options. I would think you could further distribute the load and remove the disabling of autoCreate/autoIndex though I have not confirmed this.

connectOptions: {
      writeConcern: {
        w: 'majority',
      }
    },

Did you experiment with that?

Disable auto…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hdodov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants