Altering the mongo uri in Strapi does not produce any changes

After successfully setting up a Strapi cms instance with a remote Atlas db, the next step is to create additional environments. However, I encountered an issue when attempting to modify the development database uri in the config/environments/development/database.json file - the changes did not take effect even after:

  1. Altering the value
  2. Executing strapi build
  3. Running strapi develop

Despite these efforts, the old content persisted without any updates.

Answer №1

Important data isn't solely kept in the database; model configurations are also saved in separate files.

Answer №2

To update the configuration file values, make changes in the following file path:

Path: ./config/environments/(development|production)/database.json.

For instance:

{
  "defaultConnection": "default",
  "connections": {
    "default": {
      "connector": "strapi-mongoose",
      "settings": {
        "client": "mongo",
        "host": "ds125048.mlab.com",
        "port": "25048",
        "database": "myapp-development",
        "username": "myusername",
        "password": "mypassword"
      },
      "options": {
        "authenticationDatabase": "myapp-development",
        "ssl": false
      }
    }
  }
}

After updating the values, deploy your application again.

Find more details here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to call another "put" action method within the same controller file?

My project revolves around the interaction of two models - User and Request. A User can create a food delivery Request, attaching tokens as rewards. Another User can then help deliver the request and claim the tokens. Within the same controller.js file, I ...

Why does my express POST request result in an empty req.body in Node.js?

After confirming that my data is being passed correctly and the db connection is successful, I am facing an issue with my ajax request. Even though the success callback returns the id, my data seems to not be passing through properly. When attempting to a ...

Encountering difficulties installing socket.io using npm on Centos 6.4

Currently in the process of setting up socket.io via npm on a fresh Centos 6.4 (running on a virtual machine). (using root access temporarily for testing purposes) [root@localhost lib]# npm cache clean [root@localhost lib]# npm install socket.io npm http ...

NodeJS API integration failure during ReactJs login attempt

Currently, I am tackling a small project on implementing user login functionality in ReactJs with Nodejs and Express-session. The issue I am facing is that my front end (React login page) isn't functioning properly. Below is the Fetch API code snippet ...

Is there a way to consistently substitute a specific path parameter with a different value within node.js?

Snippet of my coding: router.get('/name/:name/height', (req,res) => { ... } router.get('/name/:name/weight', (req,res) => { ... } router.get('/age/:age/height', (req,res) => { ... } router.get('/ag ...

Generate a list of users using Angular in an efficient manner

I am working on creating a user list similar to the image provided below. I am using Angular and Bootstrap for the basics of this project. However, my concern is how to efficiently handle a large number of users. If the user count exceeds 10k, what would b ...

Troubleshooting issue with parsing MySQL data in HTML table using Node.js

Seeking Assistance! I am currently in the process of developing a node file that displays data from MySQL on an HTML page with a search bar. My issue is that sometimes when I run the code, enter something into the search bar and hit the button, it works s ...

nodejs express routing issue resulting in not found error

I recently started a new node project and wanted to enhance my route adding capabilities. In the past, I only went one level deep with folders, but this time I wanted to go further. To achieve this, I created a recursive function that adds routes and navig ...

Is it possible to host a website created using Node.js on a web hosting service?

Currently in the process of creating a website using node.js and have a query regarding uploading it with Filezilla similar to other websites. Apologies for what may seem like a trivial question ...

React: Exploring the intricacies of importing components in the component-oriented versus library-oriented approach

Someone mentioned to me that there are two distinct methods for importing components/modules. The component approach The library method Does anyone have insights on these concepts? ...

Running a JavaScript file with Node.js

My node.js script is named Index.js and I also have another file called bot.js. How can I execute the bot.js file using Node.js? var fs = require('fs'); const commandFiles = fs.readdirSync('./users/commands').filter(file => file.e ...

Discovering a BTC address using a public key with node js

My apologies for any language barriers! Is there a way to decode the hexadecimal public key from a BTC signature script into a string address using node js? For instance, if I have this hex public key: 03745AAAF364030720B2D14DE50A3310EEF521C91E36353DCA2 ...

Order by the numerical value within a string field in a MongoDB collection

I have a collection of data stored in my MongoDB database like this. { "_id": ObjectId "username": "username-7" }, { "_id": ObjectId "username": "username-1" }, { "_id": Object ...

When using npm nodemon and npm colors together, unfortunately the colors are not displaying properly alongside nodemon

Can anyone provide guidance on how to use 'nodemon' to display console colors using the npm 'colors' package? Is this even feasible? I just learned today about the 'colors' package, which allows me to output colorful strings ...

Injecting data into a Q promise

I'm facing some issues related to what seems like JavaScript closures. In my Express + Mongoose web application, I am utilizing the Q library for Promises. I have a question regarding passing request data to the promise chain in order to successfully ...

What is the best way to remove a global symlink in npm without impacting local dependencies?

As a developer of an npm package, I often need to use the local version of my package. To achieve this, I utilize the npm link command, which creates a global symlink to my package. However, once I am done working with my package, I need to remove this glo ...

What are the steps to fix a timeout error with React.js and socket.io acknowledgements?

My setup includes a Node.js server and a React.js client application. Data is exchanged between them using socket.io, but I'm running into an issue with implementing acknowledgment. Whenever I try to implement acknowledgment, I receive a timeout error ...

What is the best way to recover accented characters in Express?

Encountering issues with accented characters in my POST request .. I attempted using iconv without success.. Snippet of my code: Edit: ... var bodyString = JSON.stringify(req.body); var options = { host: XXXXX, port: XXX, ...

Is there a way to transmit a div using Node.js?

Scenario: I am developing a web application that allows users to draw on a canvas, save the drawing as an image, and share it with others using Node.js. Current Progress: Drawing functionality (real-time updates on both clients). Saving the canvas as a ...

The inner joins in my SQL query are causing me to receive duplicate results

I am trying to retrieve the posts made by users followed by the userID (? in the query), as well as the posts by the user themselves. SELECT posts.id AS postid, posts.user AS user, posts.images AS images, posts.post_created, posts.textvalue, posts.te ...