Comments (5)
I would like to take this on if possible.
Just to understand where the issue is, is this where we are looping through the parent comments?
from software-engineering-daily-api.
Still working on this, just haven't been able to dedicate much time to it. Just wanted to post here to keep it updated.
from software-engineering-daily-api.
Perfect and yeah exactly that :) . The last two functions on the Controller.model : https://github.com/SoftwareEngineeringDaily/software-engineering-daily-api/blob/5664f36eb976aabb76c58d03a4375b92fd5c680a/server/models/comment.model.js
Note the lean() call, since we modify those objects when populating the votes on each comment.
Most of this logic could also be moved from the controller to the model (like in the Post model).
from software-engineering-daily-api.
To approach this problem, I was going to add a method to take in all the parentComments
and return childrenComments
. I would make the query similar to this to return multiple documents?
Something I see we may have to do, is when we have all the childrenComments
, we would then have to loop through them each one to add them to the appropriate parentComment
which is happening here. I'm assuming that would still be preferred over sending a query for each parentComment
though.
from software-engineering-daily-api.
👍 That's right, we just want to avoid the multiple queries
from software-engineering-daily-api.
Related Issues (20)
- Improve Onboarding Experience
- Add "upvoted" and "downvoted" to 'listened' api, for recent activity feed
- Ability to Save to Listen Later From Desktop To Phone HOT 2
- Add section to readme for env vars
- Automatically Scrape "Show Notes" and add them to "Related Links" HOT 1
- Create Wiki Feature Backend
- Create notifications backend
- Architect badge system
- Guest object system project
- Missing `AWS_PROFILE_PIC_BUCKET_NAME` in development image tag HOT 5
- As a listener, I would like to filter out episodes I have listened to HOT 2
- Prevent broken `author` ObjectId references in forumthreads collection HOT 1
- MP3 URL is not provided as https
- New route with less user info for comments
- [Help] How to populate Posts? I could not find any POST request to populate /api/posts HOT 6
- Bookmarks Question HOT 8
- Rename Backend Heroku API
- Migrate to Render
- Migrate api code to typescript
- Migrate api to graphql for easier cross-platform access and addressability on the frontend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from software-engineering-daily-api.