Questions tagged as 'nodejs'

1
answer

discover loopback models js

I am trying to discover the models in an oracle database with loopback as the documentation says but I do not know how to generate the .json models, they know of some example, in the documentation it says that it should be used with fs.writeF...
asked by 29.04.2017 / 06:10
1
answer

NodeJS consume functions that have parameters (res, req) from another file.js

I have the following problem, which I think is very simple, but I am very new to node, so I still have problems with these things. I have a .js file that connects to an external service and makes use of (res and req) and returns it as json....
asked by 17.05.2017 / 23:24
2
answers

Problems when extracting several jsons with queries in a nodejs module

I have a module in a route that needs to return a json with the content of several queries made in the same module and some of these queries are made with data extracted from the first queries, my code is similar to the following, but the proble...
asked by 17.05.2017 / 23:57
1
answer

Error socketio in google computer engine

Anyone who managed to integrate socket.io in a google compute engine? what happens is that I'm trying to integrate but the client does not connect main.blade.php window.socket = io("{{env('SOCKET_URL')}}:{{env('SOCKET_PORT')}}"); window.cha...
asked by 12.04.2017 / 18:55
1
answer

As documents returned by mongoose

I'm trying to manipulate a document that returns me a mongoDB query through mongoose but I manage to get it. I'm developing with Node.js with Koa and Mongoose framework as ODM. The code is: const Router = require('koa-router'); const Restau...
asked by 11.04.2017 / 17:44
1
answer

Index correctly to optimize a query

I have a problem with a query type for MongoDB. In a data collection I have indexed almost all fields with {a: 1}, {b: 1} ... and queries like the following have a very good performance: db.installations.find({deviceToken:"mydevicetoken"})...
asked by 04.04.2017 / 13:59
1
answer

Modify MYSQL query to show message in case of not finding data

How can I modify this query so that if it does not find results from a demo_id in the tags table instead of showing the demo in the answer where the tags should go, say something like no category . Inquiry SELECT 'i'.'name', 'i'.'id',...
asked by 05.04.2017 / 23:23
0
answers

Return query as array - NodeJS

I have this query that I do in my REST API which lists the items in the following way. Inquiry SELECT 'i'.'name', 'i'.'id', 'i'.'img', 'd'.'url', GROUP_CONCAT(t.name SEPARATOR ', ') as tags FROM 'demos' i INNER JOIN 'details' d ON 'i'.'id'...
asked by 29.03.2017 / 23:55
1
answer

How do I use the mysql node module from ionic 2?

I need to connect to a database using the mysql module of node_modules, using the ionic 2 framework, in previous projects where I worked with express only easily, but with ionic 2 I do not know how to integrate these, what I have achieved find o...
asked by 25.05.2017 / 18:52
1
answer

Add FK to table (association) in the model, sequlize in node (angular fullstack)

I need to add FK in the tables, I've tried it in the following way and I can not do it. Index.html db.Country = db.sequelize.import('../api/country/country.model'); db.City = db.sequelize.import('../api/city/city.model'); module.export...
asked by 09.05.2017 / 21:08