Posts by MatheusPedro • 90 points
4 posts
-
2
votes1
answer197
viewsA: How to select 2 objects from an array
To remove objects you don’t have s:2 or s:3, you can give an update: db.mycollection.update({ }, { $pull: { "lista": { s: { $nin: [2, 3] } } } }, false, true ); After the update your document will…
mongodbanswered MatheusPedro 90 -
1
votes2
answers230
viewsA: Vuejs "Typeerror: Devices.push is not a Function"
I read the code, and I realized you’re trying to access the variable i outside the scope of the for, in addition to trying to access this.devices. These two variables are causing your typeError Try…
-
2
votes1
answer121
viewsA: Always start Mongodb
You can set mongoDB as a service, to be booted together with Windows. mongod --dbpath "{{seu_diretorio_do_mongo}}" --logpath "{{seu_diretorio_do_mongo}}\logs.txt" --install --serviceName "MongoDB"…
-
1
votes1
answer100
viewsQ: Simplify foreach to update a mongoDB doc that has nested objects and arrays
I want to update the value of the 'shouldSendAlert' key in a mongoDB document that is in the following structure: { "_id" : ObjectId("5c61c4db46d18e1092c5b024"), "service" : "SRVPVD", "menu" : [ {…