Having developed a website using Node.js with MongoDB Atlas as the database, I encountered no issues while testing it on Heroku. However, after purchasing my domain and switching to proper hosting, I faced challenges. I attempted to set up my website by c ...
please provide proper image description I am encountering a CORS error when trying to fetch data from the MongoDB Atlas API. Interestingly, the request works without any issue in Postman and Thunderclient. ...
Encountering an issue when attempting to post data in MongoDB atlas. const express = require('express'); const router = express.Router(); const Persons = require('./PersonsSchema'); router.post('/',async(req,res)=>{ console.log(req.body.Name); ...
I recently made some updates to my signup page by adding a new input field for the user's name and adjusting the schema settings accordingly. How can I now retrieve this name to use in both my post-list component and post-create component? Here is an exam ...
I am currently working on developing an API that can return search results based on multiple parameters. So far, I have been able to successfully query one parameter. For example, here is a sample URL: http://localhost:3000/api/search?term=javascript& ...
const express = require('express'); const bodyParser = require('body-parser'); const mongodb = require('mongodb'); const mongoose = require('mongoose'); const dbPath = "mongodb+srv://<Admin>:<615d5846c>@cluster0-4gelt.mongodb.net/test?retryWrit ...
try { if (!conn) { console.log("Attempting to Connect to Atlas"); conn = await MongoClient.connect(process.env.MONGO_URL, { useNewUrlParser: true, useUnifiedTopology: true, }); console.log("Success ...
Even though I am able to retrieve the products when I log the const products variable, I am encountering issues when attempting to insert data into my MongoDB database. The error message states that mongoClient is not connected. const express = require("ex ...
I am working towards the goal of uploading images to MongoDB Atlas using Multer. Currently, I have an example set up with express-generator, which includes the following relevant files: app.js: // ... var app = express(); //Set up mongoose connection va ...
Is there a way to save integer values as int32 or int64 in my Atlas Trigger (NodeJS code)? Currently, when I save any value, it is saved as a Double instead. user_collection.updateOne({"_id": "anyID"}, {$inc: {"score": 2}}); ...
I am working with a simple MongoDB Atlas trigger in NodeJS: exports = function(changeEvent) { // Implementing an HTTP request }; The main objective is to invoke an AWS lambda function from this trigger. Therefore, I am seeking guidance on the synta ...
When using Terraform to create an Atlas cluster, the output I am receiving is incomplete for my request. Terraform is providing me with: mongodb+srv://esc-app-dbcluster-devel.b59mwv7.mongodb.net However, what I actually need is more along the lines of: ...
I've been working on setting up an Authentication system using NextAuth in my Next.js app. I decided to use NextAuth Credentials as the provider along with a custom login screen. Currently, I am utilizing NextAuth v.4 for this setup. In the past, I estab ...
This is my first time deploying an app, and I'm facing a particular issue. When hosting the app locally, I can use mongo (via Atlas) without any problems. Users are created on sign up, and they have a session. However, when I deploy the code to Heroku (us ...