adilfaiz001 / learning-hub Goto Github PK
View Code? Open in Web Editor NEWThis repository is to mark daily checkpoint, hurdles faced or any good learning which needs to be noted in all areas of software development, will noted in issue section
This repository is to mark daily checkpoint, hurdles faced or any good learning which needs to be noted in all areas of software development, will noted in issue section
constructor
If this is part of parent and parent loads then irrespective of a child being routed or not, constructor loaded.
onInit
Function loaded on create a view as if parent loaded or not, it doesn't effect child.
REFERENCE
https://stackoverflow.com/questions/29634150/updating-nested-array-inside-array-mongodb, https://www.nodechef.com/docs/cloud-search/updates-documents-nested-in-arrays
PROBLEM
Updating value of key in a object which is part if nested array, e.g.
Updating value of status inside double nested array
When one schema is using reference to other schema and other schema is using nested level of reference, -
QUERY EXPLANATION
In above query, KEY company is being populated and KEY company_details is selected and further populated, from which KEY followers is selected, which is array of REF OBJECTID to another schema of users, therefore, its being populated as followers.user
company: {
company_details: {
followers: {
user: [{ref: OBJECTID}]
}
}
}
New comment to be added to the comments document in an array, so using findByIdAndUpdate with query function $push to add element in the array. This successfully added the comment in the document and return whole comments document with array of comment objects
There is no reference to the comment in an array which comment is added(as of now, its push method on an array, so it is last element) but thinking of issue like in future when multiple user comment on same post, will this query return updated array, example : user_1 commented and query adding and returning it while user_2 at same commented on this and user_1 query return a new updated array, will this array last element be user_1 or user_2 ?
Selecting all documents of a collection and grouping them by a key and pushing all document of that particular key into a array, against that key_
RESULT:
[
{
company: "ABC",
product: [
{product_1},
{product_2}
]
}
]
NOTE: Use $$ROOT for pushing complete document into array in parallel with a key which is aggregate by group
DOING
Sending Array in POST Request and server receives this as string, parsing array using middlewares/parsers and then using it.
STANDARD
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.