Please help a junior engineer out!!!!!

I am given a task by my senior engineer, and I am at my wit's end at how to do it. I tried asking AI as much as I can without putting in my codebase, searching it up, looking at documentation until 4am yesterday. I am still stuck.

Suppose I have model X, which holds an array of model Y. X and Y both have status fields, but they are different. Y.status refers to that individual item's status, for example, accepted, cancelled, pending, etc. X.status refers to the overall status of all it's Y array items, it depends on their values. Usually, for a single X update, there is a function that iterates through that X's Y children, and it calls the .save() method. The feature I am tasked with implementing is

1: Making changes to a large number of X documents' Y children based on some criteria
2: Recalculating all the affected X's overall status since its children Y changed.

At first, my solution was to iterate over every X, call the function to calculate its new overall status, and use the .save method to update X's overall status. I see now this doesn't work at production scale. Promise.all() on potentially a large number of X documents may cause stack overflow, and it is a lot of write calls to the database which is not ideal.

My senior engineer told me to call that function inside a update many, but after the meeting I looked it up, and I am pretty sure mongo can't just call functions defined on the node server, and copy pasting the function again as a $function in a aggregation pipeline is also bad for performance.

There are a lot of if else branches in the function needed to calculate X's overall order status. I considered a bulk write with a lot of updateMany calls looking for a specific condition, but that would easily be over 10 updateMany's in the bulkwrite.

I am really stressed about this. Would love everyone's engineering input.

reddit.com
u/Mango__DB — 14 days ago

Started drawing about a month ago! I posted my first drawing here a while back, too scared to try color and I gave it a shot

I got out of my comfort zone and tried drawing in color. I realized that things don't actually have lines and separation is mostly can be seen by light/shadow so instead of placing the line art on the top, I put the line art layer below to force myself not to rely on lines for definition.

I had some questions about coloring:

  1. Selecting colors. How do I do it well? Especially the shadows, I keep having to draw over my shadows because I am not satisfied with the color. Also, for some reason if I use the eyedropper tool on a previous part that I painted over because i want that color, when I use it the color is LIGHTER than what I colored previously, even after I color in the same spot until it doesn't go darker. How does that happen? I have to go back to my color history to painstakingly find the color I used.

  2. Is it bad to use liquify? So many times when I am rendering I realize that things are just way bigger than they should be, I think its because when I am trying to use light to render stuff things just become bigger as they aren't contained by lines. Realize I am using liquify a lot because once color is added changing things becomes so much harder.

  3. Is it bad to stop working on a piece? I tried coloring in her clothes and it was too hard. I started to want to draw something else

u/Mango__DB — 2 months ago

HOW TO DRAW A PERSON! (Beginner Friendly Step by Step)

I started drawing a week ago, and I was trying to follow this tutorial by SamDoesArts, and everytime I draw I end up with more questions than I start. Can anyone help critique what I did and why it looks so off? It looks similar but at the same time doesn't look alike, I wouldn't recognize who it is from looking at it. I think the eyes are the wrong size and the space from the eyes to the temples look far, but when I try to make them narrower it looks even weirder. Also how do I draw hair 😭. Is this good enough to try coloring it in or should I work on more line art?

EDIT OMG I FUCKED THE TITLE ITS THE TITLE OF THEY OUTUBE VIDEO

u/Mango__DB — 3 months ago

Best way to tell teammates to wait for me when I don't have chat enabled?

Happens everytime, 30 seconds before objective, I just get enough gold for rabadon for a big power spike, I am on my way and the team fights without me. I feel like on my way is misleading because they might go and danger/caution ping would think I don't want to contest the objective at all. I want a WAIT! PLEASE I AM DOING SOMETHING! LET ME COME FIRST ping

reddit.com
u/Mango__DB — 5 months ago
▲ 4 r/Naruto

What are the limitations of Sasuke's rinnegan?

Sorry if this is asked before, I watched a lot of short videos on youtube and I find it so fascinating, but I am intimidated to start watching the show as it is very long. I didn't know the terms so I couldn't search this up.

If I am not mistaken, Sasuke has the ultimate rinnesharingan eye, and looking at what it can do I am so confused as to how he chooses to use it. He seems to have multiple abilities that can just one tap people, and while others also have their own sure kill techniques, I heard Sasuke has an ability where he can swap places with anything. So it seems like he can just point a deadly ability at himself and switch with something at the last nanosecond to land a surefire technique. I don't know how he can ever lose like losing to naruto at the end or losing to some other people in boruto. I'm looking at how much Todo in jjk can get mileage out of his boogie woogie despite sasuke seeming much stronger. Is there something I don't know? A lot of the clips of fights on youtube it seems like they are doing a lot of hand to hand fighting which looks really cool but also seems to ignore what he can do. I think I'd spam the shit out of that move lol

reddit.com
u/Mango__DB — 5 months ago