How to represent graphs and query them in MongoDB - model comments and replies - $graphLookup

Поделиться
HTML-код
  • Опубликовано: 16 окт 2024

Комментарии • 15

  • @Rowadz
    @Rowadz  2 года назад +6

    How to represent a graph in Postgresql
    ruclips.net/video/3WXiCT6jurk/видео.html

  • @erickweil4580
    @erickweil4580 2 года назад +1

    Thank you for the detailed explanation. I was making a collection of history parts who could have up to three children and one parent and made it as a double connected reference tree graph (Each document has the text, the parent Id and a list of children Id).
    Then the aggregation starts at the leaf and go up using graplookup to get all parents recursively. I was wondering about the performance and other way of doing it that was faster. After watching your video I propose a third way that is a combination of 1 and 2:
    Third way of doing things: Store the children Id, the direct parent Id, and a list of all the grandparents Id. That way a single document will reference all it's parents not needing recursive graph lookup, but still each document is stored separately and if each reference is 12 bytes, will take a extreme case to reach max document and/or aggregation size. (My use case starts at the leaf and search up, idk if this helps starting at the root and searching down)

    • @Rowadz
      @Rowadz  2 года назад

      I think we need to do some benchmarks to get some insights into the performance of each approach, in my case I remember way 1 worked perfectly so I used it without doing any benchmarks.
      your way is valid, I think that's the beauty of NoSQL, we organize the data based on our needs and how we use it.
      nice

  • @samehmouldi2289
    @samehmouldi2289 8 месяцев назад +2

    Is it functioning properly without utilizing $replaceRoot to set it as the new root?

  • @diederikfrombelgium
    @diederikfrombelgium 2 года назад

    Thanks for sharing! This was very well explained!

    • @zummotv1013
      @zummotv1013 Год назад

      can i get nested json as output using graphLookpup ?

  • @mohammedg485
    @mohammedg485 2 года назад

    keep it up my man
    your channel is amazing

    • @Rowadz
      @Rowadz  2 года назад +1

      Thanks

    • @zummotv1013
      @zummotv1013 Год назад

      can i get nested json as output using graphLookpup ?

  • @hassanmhassan5500
    @hassanmhassan5500 11 месяцев назад

    Thanks for the great content

  • @zummotv1013
    @zummotv1013 Год назад

    can i get nested json as output using graphLookpup ?

    • @Rowadz
      @Rowadz  Год назад

      I'm not sure if there is an easy way to do this

  • @markas_js
    @markas_js Год назад

    Great video.

    • @zummotv1013
      @zummotv1013 Год назад

      can i get nested json as output using graphLookpup ?

  • @BenjiBenning1
    @BenjiBenning1 Год назад

    good job man. some very good ideas here.