Category "mongodb"

Schema for saving a lot of questions MongoDb

If I have a survey application for child tracking what is the best way to save survey questions in MongoDB? Knowing that survey is divided into stages (about 12

why ejs displays file.forEach is not a function

I have the following error TypeError: C:\Users\USER PC\Documents\Prime_News_Hub\views\Top_Stories.ejs:27 25| 26| <% if(file){ %>

Mongoose data Writing issue in Javascript

Just started with a javascript couple of days back. I am trying to use MongoDB with mongoose to write the data but it is not writing even though the connection

How to fill missing field values with linear interpolation?

I have a collection of documents representing values at specific dates. Some of those dates don't have a value (the field can be missing or set to null). I'd li

Clojure - How to connect to MongoDB/DocumentDB via TLS Connection using Monger

I am not able to connect via TLS and monger to an AWS DocumentDB database. I downloaded the PEM file from AWS and added it to a new keystore file keytool -impor

is installing mongodb on cpanel reliable?

CPanel says that it does not support mongo installation but I can install it manually. My question is should I install it or just subscribe mongo atlas and conn

Get updated value from database

How do I watch for a specifc Mongodb-query? Currently I have tried with collection.watch(), but I am only getting the new value. An example: user1 = [user3, use

How to project only the fields present in an array in MongoDB?

there is a document schema that has an array field called "updatedFields" which contains some fields names that you will find in "oldDocument" and "newDocument"

decrease number server making with express put method

I am trying to decrease the quantity, which I have to change on mongodb database, also I need to show it in body. I set a button called delivered which will de

$geoWithin return document located outside the polygon queried

I've recently came across this behaviour that I cannot explain. $geowithin return documents outside the polygon queried. To illustrate my problem, I've made a m

Getting "Failed - File incomplete" in Chrome when downloading file from MongoDB

My JavaScript application allows users to download a file. The page shows a clickable link to the file. The file is stored in MongoDB. When I click on the link

find customers in zip code using mongodb aggrigation

I have 2 mongodb documents shop and customer shop documents are like below { id: 1, zipcodes:[ '12345', '11111', ] } { id:2, zipcodes:[ '45678', ]

Is that posssible to post method use in 2 server side url

I added a form and from this value all I set in const then post in API express js server with MongoDB how can I post method use post in 2url const handleSubmi

Java Spring Reactive, returning one Mono<..> from many multiple requests

[Java, Spring Reactive, MongoDB] I'm currently trying to learn Reactive programming by doing and I found a challenge. I have db object CategoryDB which looks li

How to update a single property using PATCH method in Node JS? [closed]

I want to create a PATCH method to update a single property for my API but there is something I don't understand.

mongodb returns matchCount 1 but modifiedCount 0

I was making a web app where a card is showing the quantity of a product. There is a button also named Delivered. After clicking the button, I want to decrease

MongoServerError: bad auth

I make an app using node.js. and connect this with MongoDB. But when I start my server it gives me an error. The error is below. Example app listening on port 5

How to update key values by append the existing one for the record in MongoDb collection

I have a Collection allRecords as {'name':'tom', 'subjects':'Physics'} {'name':'jerry', 'subjects':'Maths'} I have one json file is testData.json as {names:",t

Get previous and next inside sub array in MongoDB

I have a database as below. [ { "title": "Data 1", "slug": "data-1", "sub_docs": [ { "name": "Sub Doc 1"

Mongoose.connect keeps coming back undefined

I have this mongoose.connect statement in my server.js file: const db = mongoose.connect(config.db, { 'useNewUrlParser': true, 'useUnifiedTopology': tru