Posts by Gonsalo Sousa • 361 points
11 posts
-
2
votes1
answer323
viewsA: How to pass several parameters to query in Mongoose?
You can use the operator $in. const chavesDeBusca = ['laranja', 'melancia'] // cria a query const query = model.find({ 'atributo': {'$in' : chavesDeBusca } }) // resolver os resultados utilizando…
-
2
votes1
answer828
viewsA: How to Save and Recover Images in Base64 using Mongoose in a Nodejs Service?
You can transform Arraybuffer to Base64 as follows var base64Image = new Buffer(arrayBuffer, 'binary').toString('base64'); Where the arraybuffer in your case would be documento.avatar.data…
-
1
votes1
answer646
viewsA: How to search for Id in mongodb
The correct denotation would be. var user_id = "as23df56hg"; //retorna um array de Tasks do respectivo query var tasks = Tasks.find({ "userId" : user_id, "done" : true }).fetch(); You can also use…
-
1
votes1
answer129
viewsA: File . reg or . txt in windows
Unfortunately you cannot do it through PHP. Try Vbscript. Idea: Vbscript will create a task (if it does not exist) in the "Task Scheduler" that will execute the same of X in X…
phpanswered Gonsalo Sousa 361 -
1
votes2
answers202
viewsA: Change the position of a word in the text (Javascript)
Here is a more elaborate version making use of the input[type=range] document.getElementById('posicao').addEventListener("input", function() { var posicao = this.value; //guarda a posicao do input…
-
3
votes1
answer2349
viewsA: How to rotate a div?
Boas Goncalo, below I leave an example of how to achieve the pertendido result. document.getElementById('rotate').onclick=function(){ document.querySelectorAll('#main_div div').forEach(function(el){…
-
0
votes2
answers135
viewsA: Return all constructor parameters of a function in Javascript
Well from what I realized Voce wants to return all the parameters defined in the constructor, I just didn’t quite realize where the object arguments comes. We can return the parameters in the…
-
1
votes2
answers173
viewsA: How to make multiple values into a single option and retrieve them
Find the answer to your question below. var opcao = document.getElementById('teste'); //busca o select function extrair(separador){ //funcao extrair que retorna um array com os valores…
-
2
votes1
answer101
viewsA: Javascript Loop - 1 + input
Find below the answer to your question, I think the doubt would be like seeking the value of input document.getElementById(ID_DO_ELEMENTO).value document.getElementById('go').onclick = function() {…
-
4
votes4
answers8175
viewsA: What is the opposite of the "None display"?
The opposite of display:none sera display:block Since it is to be used Javascript, consider also jQuery, can achieve the same result in an easier and more intuitive way as for example:…
-
0
votes3
answers15260
viewsA: How to insert an image in my html doc to serve as background image(background)
Utilize CSS to achieve the pertendited result background-image: url(CAMINHO_DA_IMAGEM). Find below an example of how to use CSS to insert a background image across the page. <!DOCTYPE html>…