Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up MongoDB environment requirements for Parse Server

I have my instance running and am able to connect remotely however I'm stuck on where to set this parameter to false since it states that the default is set to true:

failIndexKeyTooLong 
like image 772
Daisy R. Avatar asked Jan 30 '16 21:01

Daisy R.


1 Answers

Setting the 'failIndexKeyTooLong' is a three-step process:

  1. You need to go to the command console in the Tools menu item for the admin database of your database instance. This command will only work on the admin database, pictured here: enter image description here

  2. Once there, pick any command from the list and it will give you a short JSON text for that command.

  3. Erase the command they provide (I chose 'ping') and enter the following JSON:

    { 
      "setParameter" : 1, 
      "failIndexKeyTooLong" : false
    }
    

    Here is an example to help: enter image description here

Note if you are using a free plan at MongoLab: This will NOT work if you have a free plan; it only works with paid plans. If you have the free plan, you will not even see the admin database. HOWEVER, I contacted MongoLab and here is what they suggest:

Hello,

First of all, welcome to MongoLab. We'd be happy to help.

The failIndexKeyTooLong=false option is only necessary when your data include indexed values that exceed the maximum key value length of 1024 bytes. This only occurs when Parse auto-indexes certain collections, which can actually lead to incorrect query results. Parse has updated their migration guide to include a bit more information about this, here:

https://parse.com/docs/server/guide#database-why-do-i-need-to-set-failindexkeytoolong-false-

Chances are high that your migration will succeed without this parameter being set. Can you please give that a try? If for any reason it does fail, please let us know and we can help you on potential next steps.

Our Dedicated and Shared Cluster plans (https://mongolab.com/plans/pricing/) do provide the ability to toggle this option, but because our free Sandbox plans are running on shared server processes, with other Sandbox users, this parameter is not configurable.

like image 161
Ryan Kreager Avatar answered Oct 31 '22 17:10

Ryan Kreager