Good practice for "post" document?
Reddit » MongoDB
by /u/VehicleAppropriate75
5h ago
Hey guys, I'm not sure whether this is the correct sub to ask this on (please let me know if it's not). I'm assuming this is a basic dilemma for developers, I want to create a collection of posts, for example on social network, then each post should include the details of the user, such as name and avatar as part of the post. If in each document I just insert the userId for this additional data (name and avatar), I should perform an additional lookup for each document. Alternatively, I could insert this data directly in the post document, and then if the user changes their data later, I shoul ..read more
Visit website
How to query for a nested field that is in a relation
Reddit » MongoDB
by /u/heretolearn9721
16h ago
Lets say i have this Receipt { billValue: 120 CustomerId: 12345 } Customer { Id: 12345 State: “active” } I want to get all receipt with active customers submitted by /u/heretolearn9721 [visit reddit] [comments ..read more
Visit website
Tinder like match system
Reddit » MongoDB
by /u/Beagles_Are_God
22h ago
Hi, i'm implementing a tinder like match system for a school project using Express and Mongo. Currently these are the relevant entities, i must say i come from a very relational dbs background. User Like Match So, basically, when a user A gives another user B a like, it creates a new like document, then will look if another like document exists where the user A is the reciever of the like, if that document exists, it creates a new Match. Is this approach correct? I'm using PrismaDB as the ORM and the Match model looks like this https://preview.redd.it/p0oh7m1k9gwc1.png?width=1258&format=p ..read more
Visit website
Need help setting up a database connection
Reddit » MongoDB
by /u/MangosRsorry
2d ago
I am currently using mongodb (atlas if its important) to set up a database. Unfortunately, I keep running into the problem of my connection. However, I have successfully made a connection before on the same network so I am confused. There is a message that keeps coming up saying current IP address not added (It is) and to add it. When I click add IP it turns blue and says connection works, although the current IP address it says is mine is not correct. Anyway in about it minute it always just reverts to saying IP not added. Does anyone have any suggestions? Im not using a vpn or anything eith ..read more
Visit website
What sort of transfer speeds between nodes can be expected in an ideal replica set environment?
Reddit » MongoDB
by /u/Old-Air-9130
2d ago
I am only seeing 50mbit/s speeds over a 2Gb/s connection when replicating between two nodes at different physical locations. This is during an initial sync which should be the "quickest" time because it has so much data to move (around 2TB). It is my understanding that replication transfers over a single TCP connection per node. Default settings are what we currently are testing with, so default write concern is "majority". I have even tried turning off flow control to see if that was the issue, but it is not. What speeds are you seeing in your setup? Thanks! submitted by /u/Old-Air-9130 [vi ..read more
Visit website
MongoDB Live: Revolutionizing Legal Work: How Genie AI and MongoDB Enhance In-House Legal Teams
Reddit » MongoDB
by /u/alexdenne
2d ago
Learn more about the MongoDB Advocacy Program → https://mdb.link/genie-community See how Genie is using MongoDB Atlas → https://www.genieai.co Try Atlas for Free → https://mdb.link/genie-free Join us on the MongoDB Podcast as we explore the transformative impact of Genie AI in the legal sector, with our special guests Dan and Ana from GenieAI. Dan, a software engineer with two decades of experience, brings a wealth of knowledge from backend to frontend development and currently serves as a backend engineer and tech lead at GenieAI. Having started his journey with MongoDB in 2010 and with a di ..read more
Visit website
Query Timing Out with Nextjs, 504 Error
Reddit » MongoDB
by /u/LowkeyWeirdBro
3d ago
Hello! I'm currently dealing with an issue with my app in which I am attempting to query for about 10,000 documents, and the query is taking about 17s. When I go into compass and explain the aggregation, it's saying the time to execute is 58ms. Compass Explain Page The structure of the query is as follows: const user = await Personal.aggregate([ { $match: { userid: id } }, { $unwind: { path: "$activity" } }, { $match: { "activity.time": { $gte: startOfDay, $lt: endOfDay, }, }, }, { $project: { _id: 0, activity: 1 } }, ]); For this schema: import mongoose, { Schema } from "mongoose"; var perso ..read more
Visit website
Getting a strange error with my query
Reddit » MongoDB
by /u/Rebmaladnah
3d ago
I'm just making a project to get a better grasp of database concepts and I'm struggling a bit. Here is the function in question: exports.updateWatchCount = async (database, username, film) => { try { const collection = database.collection('User-Accounts'); const query = { "user_name": username, "collection": { $elemMatch: { "film_name": film.film_name, "director_name": film.director_name }}}; const update = { $inc: { "collection.$.count": 1 } }; const response = await collection.updateOne(query, update); if (response.matchedCount === 0) { console.log("No matching film found to update ..read more
Visit website
MongoDB connection error: MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo
Reddit » MongoDB
by /u/Lbs20
3d ago
I m trying to add mongo db to my project first time using databases and I did add it to docker create the modules and router and now when i run i have this error anyone can help ? Server is running on port 3333 MongoDB connection error: MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo at _handleConnectionErrors (/home/node_modules/mongoose/lib/connection.js:875:11) at NativeConnection.openUri (/home//node_modules/mongoose/lib/connection.js:826:11) { reason: TopologyDescription { type: 'Single', servers: Map(1) { 'mongo:27017' => [ServerDescription] }, stale: false, compatible: tru ..read more
Visit website
Self-Hosting MongoDB TLS/SSL Paradox
Reddit » MongoDB
by /u/SlowEspressoFlow
3d ago
Hi! I'm trying to install an SSL/TLS certificate to my MongoDB. As I read, generally it’s a bad idea to expose your production MongoDB instance to the internet. Option A) Use a valid SSL certificate In this case, I need to expose my MongoDB instance to the internet to use my domain (I.e. let's say after that I'm able to access db.mydomain.com) Option B) Use a personal VPN to expose my MongoDB instance For this option, I'll be the only one to achieve it from my home PC, but having a self-signed SSL certificate will be untrustworthy. Note: In both cases, I'll limit authentication to my home PC ..read more
Visit website

Follow Reddit » MongoDB on FeedSpot

Continue with Google
Continue with Apple
OR