Questions tagged as 'mongoose'

0
answers

Aggregation in mongoDB is not working right

Hello I'm trying to filter some data to render a table in a view here. The template is EJS. What I need to do is: Count how many times an id number appears with a given status. I've been able to count the amount that an id appears, but...
asked by 10.08.2018 / 20:41
1
answer

Generate an array from a query in mongoDB (Mongoose)

Good morning! I need the data from a mongo collection on the front end. I'm using Mongoose as an ODM, and I was a little lost in sending the data to the front end. In the query it returns me the documents in the collection, and then I need...
asked by 01.08.2018 / 14:09
0
answers

Generate chart using ChartJS on Express

I'm trying to render a chart using ChartJS. I'm using nodeJS (Express) and mongoDB. The idea is to get the data from the bank, go to the front, and from there, render the chart. I already have a little notion of how to do this, one option wou...
asked by 30.07.2018 / 16:12
0
answers

Import mongoose object list

I'm trying to save data from a csv file in mongoDB, using mongoose. I need to read row by line, generate an object from that row and supplement it with other data, which comes from the user login session. To work with the csv file, I'm usi...
asked by 26.07.2018 / 16:19
0
answers

Is it possible to save document rum after removing it using a middleware in Mongoose?

I'm developing a system that requires some MongoDB documents to be kept in a database even if they have been removed, for historical purposes, so I created a plugin that inserts 3 fields: criadoEm atualizadoEm apagadoEm...
asked by 16.07.2018 / 21:06
0
answers

Using two connections with MongoDB using Mongoose with references to different collections

I have two MongoDB databases that I connect using Mongoose on NodeJS, one with an X collection that references the ID of another collection Y that is in another MongoDB database on another server. I need to unify the two databases by copying...
asked by 17.07.2018 / 00:16
0
answers

Node with mongodb not launching application

I'm trying to upload an application in Node with mongoose , (I'm studying, book MEAN home code) and it generates the following error when trying to start the file server.js where I started my application in Node, see below. Be...
asked by 13.07.2018 / 02:37
0
answers

How to perform a filter using Mongoose?

I already know how to implement a filter using the MongoDB identifier key, however I'm trying to implement a value attribute filter, and I'm not getting it, see below; What I need is that when typing the value the slug and already bring the r...
asked by 06.07.2018 / 16:25
0
answers

Error in implementing image upload on Node Express

Please see the code below function uploadImage(req, res) { var userId = req.params.id; var file_name = 'No limite...'; if (req.files) { var file_path = req.files.image.path; var file_split = file_path.split('\');...
asked by 21.05.2018 / 17:29
0
answers

Mongodb remote backup

I have an application in production using NodeJs and MongoDB through Mongoose. This same application has a version that runs on a local offline server. Both databases have the same data and back up the app online to offline. It turns out that no...
asked by 11.05.2018 / 23:10