Posts by pedrualves • 88 points
4 posts
-
2
votes1
answer105
viewsA: Group JSON using javascript reduce()
obj.reduce((acc,currentValue) => { serviceSumItem = acc.find(o => o.janela === currentValue.janela && o.port === currentValue.port); serviceSumItem ? serviceSumItem.qtd +=…
-
1
votes4
answers210
viewsA: Get post ID with Javascript
I believe it will be possible through searching for elements by classname, for example: document.getElementByClassName("representative-list")[0].getElementByClassName("post72")…
javascriptanswered pedrualves 88 -
3
votes1
answer79
viewsA: Is it correct to make a user authentication by the backend return message?
It is correct that I validate the user according to the JSON message I receive from my server like I’m doing ? Not ideal, prefer to return http status code success 2xx if login was successful and…
-
1
votes1
answer2484
viewsQ: Mongodb query and return array specific elements within objects
Guys, I need a help to query certain values in a document. I have a collection in Mongo that follows this structure, including this is the document I can and need to locate:…