Questions tagged as 'mongoose'

0
answers

Help in Mongoose and mongoDB with linked queries

I'm passing a query I made and it works on mongoDB to mongoose and it gives me an error. The query in mongo DB is: db.facturas.find({ _id: {$in: db.detalles.distinct("id_factura",{category: ObjectId("5889eae21ffcc6da2c6b4ae4")})}...
asked by 14.08.2017 / 23:36
0
answers

How to send data through a post request in NodeJS to the database in MongoDB?

I'm doing an App, which has a registry for users. I try to make that when the user enters the data they are sent to the database through that POST request. The database appears connected to me, but I can not find the code to send the data. Th...
asked by 23.06.2017 / 17:34
0
answers

Error "dup key: {: null}" mongodb

I have a mongoose schema like this: const mongoose = require('mongoose'); const Schema = mongoose.Schema; const thingsSchema = new Schema({ userId: { required: true, unique: false, type: String, }, }); module.ex...
asked by 06.06.2017 / 22:22
1
answer

I get this error cant set headers after they are sent

Hello people, I am using passport-local and what I want to do is show the user when he / she does the login My code is this var passport = require('passport'); var localStrategy = require('passport-local').Strategy; var User=require...
asked by 21.05.2017 / 01:40
1
answer

Node.js + node-xmpp.js + mongoseIM

I have a structural dilemma for my application. Currently I have an application consuming an API Rest made with Node and MongoDB. And I want to add the chat functionality. I was reading and I think the best option is to use the XMPP protocol for...
asked by 12.04.2017 / 23:05
1
answer

I can not display my mongodb data with mongoose in node.js

//myapp/routes/index.js //declaramos las dependencias var express = require('express'); var bodyParser = require('body-parser'); var mongoose = require('mongoose'), Schema =mongoose.Schema; var router = express.Router(); mongoose.co...
asked by 31.03.2017 / 17:21
0
answers

How can I compare a data binary with GridFs in MongoDb?

I am using C # and MongoDB as the database engine. In my application I keep the User's Footprint used the following lines in C #. var id3 = ObjectId.Empty; using (var file = File.OpenRead(rutaArchivo)) {...
asked by 14.11.2016 / 23:19
0
answers

Show data with Mongoose and NodeJS

I just started with this backend and I have some doubts. I have a Schema in Mongoose : const mongoose = require('./model'), Schema = mongoose.Schema, TeamSchema = new Schema({ _id : Schema.Types.ObjectId,...
asked by 10.11.2016 / 02:18
2
answers

Relationships in mongoose with personalized id

I have 2 models that I want to relate to be able to make queries in mongoose. Users Model import mongoose from 'mongoose' const Schema = mongoose.Schema let csvuaSchema = new Schema({ codigo: { type: 'String' }, georeferencia: { type:...
asked by 09.12.2018 / 23:32
3
answers

Using findOne () and findOneById with HTTP requests (Nodejs + mongoose)

I'm doing a api rest where I want to do HTTP requests using Postman, specifically I want to do a search or update a mongodb document, but this must be by an id that is not the doc_id that mongo provides. Basically what I need is for someone t...
asked by 14.04.2017 / 20:27