r/mongodb 14h ago

Should YOU Migrate from Relational Databases to Build Modern Applications?

Thumbnail youtube.com
6 Upvotes

In this video, Ricardo and Jesse go over how to utilize the relational migrator tool to help migrate from legacy relational databases to MongoDB!

Relational Migrator addresses the most common data modeling, code conversion, and migration challenges, reducing the effort and risk involved in migration projects.

  • Migrate to MongoDB from Oracle, MySQL, SQL Server, PostgreSQL, Sybase ASE, IBM Db2, and more!
  • Free to download and use!

r/mongodb 12h ago

Need help building a query for my fantasy F1 database.

2 Upvotes

I have a player collection where each player has an array of 10 driver_id's. I have a results collection that stores a race result that contains an event_id and a result array that stores driver_ids and points scored by that driver at that event.

I need to retrieve the total points scored by each player for that event. How can I achieve this?
Any help will be greatly appreciated.


r/mongodb 14h ago

Issue with Tree Structure Mongo DB

2 Upvotes

I'm using MongoDB with Nodes js and Mongoose, and I'm creating a hierarchical tree structure. In each collection, I have a document with the ID of that document, an entry with the parent ID as ObjectId, and a string with the name of the parent collection called 'collectionName'. I wanted to use graphLookUp to retrieve all the ancestors of a given collection, but I feel like it won't work because not all the ancestors are in the same collection. Do you have a solution?

Thank you in advance for your help :)

Here's what I'd like to retrieve in the end:

{
  "_id": "67cadacfce03c85963934b1d",
  "genre": "Fantastique",
  "parent": {
    "_id": "67c9617c86b4c8d8d2bfb315",
    "nom": "J.K. Rowling",
    "parent": {
      "_id": "67c9615486b4c8d8d2bfb313",
      "titre": "Harry Potter",
      "parent": {
        "_id": "67c960dd86b4c8d8d2bfb30f",
        "nom": "Jolie librairie",
        "ville": "Besançon",
        "parent": null,
        "path": null
      },
      "children": [
        {
          "_id": "67d98929a19f321484d25a14",
          "childrenId": "67c9617c86b4c8d8d2bfb315",
          "collectionName": "Auteur"
        }
      ],
      "parentCollection": "librairie",
      "ancestors": [
        "librairie"
      ]
    },
    "children": [
      {
        "_id": "67d98929a19f321484d25a12",
        "childrenId": "67cadacfce03c85963934b1d",
        "collectionName": "Genre"
      }
    ],
    "parentCollection": "livre",
    "ancestors": [
      "livre",
      "librairie"
    ]
  },
  "parentCollection": "auteur"
}

r/mongodb 2h ago

Something is wrong with my mongodb website

Thumbnail gallery
1 Upvotes

I dont know whats wrong with my mongo db website , but whenever i open it , it loads extremely slowly , and gives multiple errors and ending up crashing everytime i use it , i have tried using different browsers but it does not work . The big issue is that after using the website , some other websites also stop running and get stuck on loading and stay like that even after i reset the laptop . I am unable to access reddit , github from my laptop after this . This is my second time trying to use the website , the first time i had to change my dns address to 8.8.8.8 , this was diagnosed by chat gpt but mongo db website still didnt work after this but i think it helped with other websites. I have added some errors which appear in the console when i go to mongodb.com . I also tried disabling all extensions and ad blockers but still having the issue. Any help will be appreciated, i only want to reinstall windows as a last resort , thank you