Posts by Vinicius Spinellis • 63 points
5 posts
-
0
votes2
answers395
viewsA: Mongoose findone do not return values
Probably missing the await. If you gave the async, have to give the await to wait the query before displaying Try it this way: var user = await usersModel.findOne({email: data.email});…
-
1
votes1
answer29
viewsA: Mongodb - Use . distinct in 2 properties of a document
I think the method $unwind would solve your situation. It would first separate the items from the item and then you would give the Aggregate group. db.getCollection().aggregate([ { $unwind:…
mongodbanswered Vinicius Spinellis 63 -
1
votes3
answers1412
viewsA: Refresh only 1 time
You can create a function and apply a condition. window.onload = function() { if(!window.location.hash) { window.location = window.location + '#carregar'; window.location.reload(); } }…
-
1
votes1
answer107
viewsA: Update of an index of an array of a Mongodb document
You can use the $conditional operator along with the $set mongodb db.alunos.update( { "_id": ObjectId("5ba141b186b9fc17121423a1"), "cursos.nome": "NodeJS" }, { "$set": { "cursos.$.cargaHoraria": 120…
mongodbanswered Vinicius Spinellis 63 -
0
votes1
answer264
viewsQ: consider all fields when grouping in mongodb
I have the following array: [ { “user”: “USER1”, “last”: “USER1” }, { “user”: “USER1”, “last”: “USER2” }, { “user”: “USER2”, “last”: “USER1” }, { “user”: “USER2”, “last”: “USER2” }, { “user”:…
mongodbasked Vinicius Spinellis 63