Questions tagged as 'mongodb'

2
answers

Get connection instance

I would like to get the connection from the dbConnection.js file, but run the query on another file (DAO). I'm doing a NodeJS course and what I've learned is getting this connection and using a 'gerialized' method to run the queries. (in dbCo...
asked by 28.12.2018 / 12:51
0
answers

Two forms sending data to an Node API

I'm developing an application with Node and Mongoose. My problem is this: In the backend I have the model of an entity called Equipment. Schema has several parameters. I have a form to create a Equipment (this form works normally). The creati...
asked by 21.12.2018 / 17:45
1
answer

Why can I pass string, but I can not pass variable to query MONGO NODE

I want to return a JSON from MongoDB with some filters, the problem is, when I try to pass a variable through the function, it does not work, this is the code: async find(req, res) { const { filter, input } = req.body; console.log(filte...
asked by 30.12.2018 / 00:11
0
answers

Redeem the last MongoDB record

I'm trying to redeem only the last record from a collection in Mongo and Mongoose. Passing this command: db.measurements.findOne().sort({ field: 'updated', _id: -1 }) The following error appears: 2018-12-13T13:12:25.702-0200 E QUERY...
asked by 13.12.2018 / 16:19
0
answers

Creating a filter in mongoDB

Well, I need some help on creating a filter in Mongo DB to better organize my results. Today my database is set up like this: { "_id" : 2, "email": "[email protected]", "conversao": 5} { "_id" : 3, "email": "[email protected]", "...
asked by 05.12.2018 / 14:44
1
answer

MongoDB return last value using filter and grouping by variable

I have the following event being inserted into my MongoDB database { _id:"5c0539158863a16a282917ad", owner:"clientX", source:"Deposito01", metric:"temperature", datetime:"2018-12-03T12:09:25.000Z", message:{ temperature...
asked by 03.12.2018 / 19:16
1
answer

Does not run server.js

You are giving this error after npm run dev (I already installed the mongo and the npm models you need)    npm ERR! missing script: dev       npm ERR! A complete log of this run can be found in:   npm ERR! C: \ Users \ Getin-sds \ App...
asked by 29.11.2018 / 21:02
0
answers

Integration between Geoserver, NodeJS and OpenLayers

Good evening, I need some tips on an academic job that I'm having some difficulties with and hopefully become easier with the help of the community. I have an HTML page with a map in OpenLayers, in which I can already insert into BD (Mongo...
asked by 02.12.2018 / 03:02
0
answers

MongoDB with JasperReport

In the course of angular the teacher taught some commands to work with MongoDB using find, insert, update, updateOne and others, but with this form it is not possible to create reports with jasperReport, probably the best known I imagine, as I w...
asked by 22.11.2018 / 19:54
0
answers

MongoDB order find () per regular expression

Good afternoon. I am stuck in the following scenario: I have a database (mongodb) of names, and I need to do a search using regex (so far ok). Let's assume the bank is this: [{id: 1, Nome: "Luiz Claudio"}, {id: 2, Nome: "Luiz"}, {id: 3, Nome:...
asked by 13.11.2018 / 01:14