Questions tagged as 'mongoose'

1
answer

How to query collections with mongoose embedded fields?

learning mongoose and mongoDB I have an inconvenience that I do not know how to solve, with the following code: var mongoose = require('mongoose'); var mongooseEsquema = new mongoose.Schema({ nombre: {type: String}, apellido : {type:...
asked by 12.06.2018 / 00:28
0
answers

Paginate is not a function

Partners help me! I want to paginate the results of my Artist model extracted from mongoDB but the following error appears: Artist.find(...).sort(...).paginate is not a function This is my model const mongoose = require('mongoose'); cons...
asked by 05.06.2018 / 07:12
2
answers

Remote connection failed with MongoDB HELP

The truth is that I am a novice in programming and I have a task that is giving me a headache. It is to create a database in MongoDB that synchronizes with the data with an application in Java in NetBeans . I get it, inser...
asked by 17.05.2018 / 11:30
1
answer

Save in several collections Mongoose same call

I need to save the information of my Arrays [data_inver], [asociar_inver] in Mongoosee at the same time in a same method of my API. Right now I am launching these two methods: // save multiple documents to the collection referenced by Data_...
asked by 24.04.2018 / 13:27
0
answers

timestamps do not work on embedded documents or subdocuments in mongoose

normally timestamps would work var UserSchema = Schema ({{ name: String, description:String },{ timestamps: true }) but timestapms does not work in var UserSchema = Schema({ name: String, description:...
asked by 23.04.2018 / 19:05
0
answers

mongoose dynamic references work for me

for example the model is var UserSchema = Schema({ firstName: { type: String, required: true }, secondName: String, lastName: { type: String, required: true }, email: { type: Stri...
asked by 30.04.2018 / 19:57
0
answers

Question about post calls with postman, mongoose and populate

I am new to this and I do not know how to add an objectId from one collection to another, I saw that it is doing this in my case: {type: mongoose.Schema.Types.ObjectId, ref: 'Weapon'} But it does not work for me, first I want to create a we...
asked by 17.04.2018 / 21:00
1
answer

Mongo does not connect me to localhost

Hello, I have here all the code of js, I try to do node index.js and it does not connect me to the server, therefore I can not open theft 3t any idea? I do mongod and nothing. //DEPENDENCIES var mongoose = require('mongoose'); var m...
asked by 13.04.2018 / 12:46
0
answers

Mongoose massive inserts / updates

My application is powered by CSV files, which are parsed to JSON without problems. Once I have the JSON object I start importing let calls = []; for (let i=0; i<json.length; i++) { calls.push(import(json[i]); } Promise.all(calls)...
asked by 16.04.2018 / 14:14
1
answer

DELETE Not Found with Postman in APIREST NodeJs with Mongo and Mongosoe

How about classmates? I'm working on an api rest with NodeJs, MongoDB and Mongoose, but when implementing DELETE by Id, the postman sends me an error      Cannont DELETE /api/product/5aae8f9df40f3924a4b984f In the status of the Postman sends a 4...
asked by 18.03.2018 / 21:24