Questions tagged as 'mongoose'

0
answers

How to update a list of documents in mongodb

I'm trying to update a list of objects look like this: var lista = [ { _id: 57ea29361b297553c99d702f, nome: 'Meu nome', __v: 0 }, { _id: 57ea29371b297553c99d7031, nome: 'Meu outro nome', __v: 0 } ] model.update({}, lista)...
asked by 27.09.2016 / 10:18
1
answer

Doubt about NodeJS + Mongo application structure at Digital Ocean

I started by using 1 machine at Digital Ocean instead of UOL Host. As I do not have much experience with the server configuration part, I have 1 doubt and I hope someone helps me: Scenario: 1) My application is running on Digital Ocean o...
asked by 15.08.2016 / 19:28
1
answer

How to do a findOneAndUpdate in an array inside another array with Mongoose

I'm a beginner in Mongoose, I would like to make a change ( findOneAndUpdate ) in the second array address in the city field, I tried everything I knew and thank no one that can help. { _id: "573c5ed236c156cc2351d1ea", tit...
asked by 19.05.2016 / 20:48
2
answers

MongoDB problem in data listing with php

var mongoose = require('mongoose'); var db = mongoose.connection; // db connect db.on('error', console.error); db.once('open', function() { console.log('Conectado ao MongoDB.') }); mongoose.connect('mongod...
asked by 07.01.2016 / 15:39
0
answers

error installing mongoose on win server 2008 r2

The error below is displayed when installing mongoose on op system. server 2008r2 All applications are installed correctly. but the bank does not seem to compile. c:\program files\iisnode\www\pmt\node_modules\bson\node_modules\bson-ext\node...
asked by 10.06.2015 / 22:56
1
answer

MEAN STACK: Mongoose model blocks communication with my controller

My controller does not send data to my router when my Model is being exported into the application and I do not know why this happens. controller.js var Model = require('../models/dado.js'); exports.listaDados = function(req, res) {...
asked by 01.06.2017 / 13:59
1
answer

Working with Date and Time in NodeJS, Mongoose, and TypeScript

Good morning everyone, I come from the java world and am starting in NodeJS. I'm having a hard time understanding how to work with dates and times in NodeJS. Here is an example of the template I want to use: export interface teste ex...
asked by 23.12.2018 / 15:57
1
answer

Error query mongoose

I have a query in NodeJS with MongoDB: filter:['abertos','cancelados']; schemas.chamados .find({STATUS_CHAMADO : {"$in" : filter}}) .exec(function(err, dados) { if(err) return callback(err); else { return c...
asked by 03.03.2015 / 20:03
1
answer

Behavior of this variable in Validation with Mongoose + Nodejs

I'm trying to run a validation process for a field in the mongoose schema. However, the behavior of the "this" variable is different than expected. Well, according to the documentation at link , you should refer to the model object you are bein...
asked by 25.07.2018 / 17:35