Questions tagged [mongodb]

MongoDB is a scalable, high-performance, open source, document-oriented NoSQL database. It supports a large number of languages and application development platforms. Questions about server administration can be asked on https://dba.stackexchange.com.

164,320 questions
0votes
0answers
3views

MongoDB unique users

I am trying to create a login page where users can add favourite food item, but I'm not sure how exactly I would make it so that it knows exactly which user is logged in. I want to ultimately be able ...
0votes
0answers
3views

Aggregation $match within a $sum

I was wondering if it was possible to somehow use the $match operator within the $sum function for aggregation. { "$unwind": "$info.avatarInfoList" }, { "$unwind": &...
  • 35
0votes
1answer
13views

How to create a schema to add several array into object Node/mongo db using post

this is the schema that I have now but I need to add more array as number 2, 3, 4 > const PostSchema = mongoose.Schema({ > navigation: { > 1: [ > > ...
0votes
0answers
6views

Heroku Application doesn't work when I try to deploy MERN app

I'm trying to figure out a last assignment for my boot camp and am close to running out of time. Heroku has an application error and I can't figure out how to fix it. I've tried deleting and ...
0votes
0answers
7views

option to manually flush/write body to browser when done

I have so far been unable to sort out this issue. I have a code that uses the MongoDb driver and whenever a do a fetch operation, i can no longer write to .response.body, e.g: Once I call - await ...
0votes
0answers
7views

Difference between Model.find({key: "value"}) and Model.find().where("key").equals("value") in mongoose?

Consider the following code const mongoose = require("mongoose"); main() .catch(err => console.log(err)); const Model = mongoose.model('collection', new mongoose.Schema({...})); async ...
0votes
0answers
10views

How compare List value vs Mongoose value?

I trying this code, to get all 5 first bios value on my myDescList (because this list automatically refresh every 7 hours) to compare each bio value possible existing between desc field on my database ...
0votes
0answers
18views

Mongo pods don't find PersistentVolume to bind to Kubernetes

I'm starting out with K8s and I'm stuck at setting up mongo db in replica set mode with local persistent volume. I'm using StorageClass, PersistentVolume and PersistentVolumeClaim. I created them in ...
0votes
0answers
14views

User-created Record Fields

I am creating a web-app w/ Flask + Flask-WTF that has CRM-like features as a project. My current database (MongoDB) structure is I have: Users who can login, People who are assigned to users, and ...
0votes
0answers
6views

Mongoose: how to add new schema only if field does not exist?

I need help with my code. Trying to figure what is the best way to give some errors if specific fields already exist. Add if statement maybe on the client side if the user trying to save with a name ...
0votes
0answers
15views

How can I make Atlas search look for a keyword only once?

Let's say I have 2 documents in my MongoDB database: Document 1: title: "elephant is an elephant" description: "this elephant is an elephant" Document 2: title: "duck" ...
0votes
0answers
8views

How to limit mongodb's RAM usage?

I am running tests on the server, as a result of which mongodb starts using a lot of RAM. Mongo version 3.6.8, arm architecture on the server, there is no swap file. I've tried all the solutions from ...
0votes
0answers
9views

Prisma.js mongodb relation filter doesn't work

I have a model Post that looks like this: model Post { id String @id @default(auto()) @map("_id") @db.ObjectId createdAt DateTime @default(now()) updatedAt DateTime @updatedAt ...
0votes
0answers
14views

What is a Mongoose Query object ? Is it a promise?

Mongoose models provide several static helper functions for CRUD operations. Each of these functions returns a mongoose Query object. For example : let query = Model.find(); This returns a <...
0votes
1answer
10views

How to return aggregated document from MongoDB in Golang?

I am trying to aggregate field category (which is actually an ObjectId, but I found it more convinient to work if it is string) in my pretty generic blog post model: type Post struct { ID ...

153050per page