skip to Main Content

Mongodb – Express router is not working on mongoose. It is saying User is not defined

**App.js Code** const express = require("express"); const { default: mongoose } = require("mongoose"); const gaming = require("./routes/gaming"); const app = express(); app.use(express.json()); app.use("/", gaming); const dbConnect = mongoose.connect("mongodb://localhost:27017/Gaming"); const mySchema = new mongoose.Schema({ name: String, genre: String, games: String, })…

VIEW QUESTION

Mongodb – Github Actions Jest

My Jest tests are passing, but Github actions workflow isn't completing. Here's my main.yaml. name: Jest Unit Tests on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x, 16.x] mongodb-version: ['4.2',…

VIEW QUESTION

Mongodb – aws document db not working from node.js application

express.js code var mongoose = require("mongoose"); const { db } = require("../../models/userModel"); mongoose.connect("mongodb://cnoxbeta:abdf1234@cnox-beta-document-db.cluster-cvzxy5kwx8pn.us-west-2.docdb.amazonaws.com:27017/cnox?ssl=true&ssl_ca_certs=rds-combined-ca-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false"); error: (node:1239) UnhandledPromiseRejectionWarning: Error: error:0909006C:PEM routines:get_name:no start line at Object.createSecureContext (_tls_common.js:149:17) at Object.connect (_tls_wrap.js:1580:48) at makeConnection (/home/ubuntu/cnox-webbackend/node_modules/mongoose/node_modules/mongodb/lib/cmap/connect.js:274:31) at connect (/home/ubuntu/cnox-webbackend/node_modules/mongoose/node_modules/mongodb/lib/cmap/connect.js:33:5) at checkServer (/home/ubuntu/cnox-webbackend/node_modules/mongoose/node_modules/mongodb/lib/sdam/monitor.js:201:27) at /home/ubuntu/cnox-webbackend/node_modules/mongoose/node_modules/mongodb/lib/sdam/monitor.js:231:9 at executeAndReschedule…

VIEW QUESTION
Back To Top
Search