Questions tagged as 'mongoose'

1
answer

Error Converting circular structure to JSON

When listing the elements in the database I get the error "Converting circular structure to JSON", how can I solve it? BD Model const mongoose = require('mongoose'); const {Schema} = mongoose; const PostSchema = new Schema({ text: { ty...
asked by 15.11.2018 / 02:47
1
answer

Consultation with mongoose

I want to call all the names of a 'users' collection without the information that accompanies it, the query that I do brings all the information that is in the 'users' collection (name, surname, password) and I would just like to call the names...
asked by 05.06.2018 / 07:51
1
answer

how to refer to a schema in another folder

for example the following schemes are the following folders cr/user lms/content this is the outline contained user: { type: Schema.Types.ObjectId, ref: 'cr/user' } How can I reference a user from the schema content?...
asked by 08.05.2018 / 07:34
1
answer

Update a field in Mongoose if the new value is not null?

having a Schema like this: const FarmSchema = new Schema({ name: { type: String, required: true }, extension: { extension: { type: Number, min: 1, max: 1000, required: true }, measure: {...
asked by 05.05.2018 / 21:31
1
answer

Error with schema, model and controller (mongoose)

I'm developing an app with node.js, mongodb, mongoose and I get an error when I added these files. This is the "model.js" file: var mongoose = require('mongoose'), Schema = mongoose.Schema; var RequestDiffSchema = new Schema({ id: {...
asked by 07.09.2017 / 17:49
1
answer

Problem to access elements of a document: mongoose

I want to do a password verification using express and mongoose. All right until the part where I check the password, I just can not access that value of my document. This is my function: function iniciar_sesion(req, res) { let usu = n...
asked by 26.12.2016 / 21:01
1
answer

Multi Relationships with Mongoose

is the first time I write, I have always solved the problems with questions from others, but this time I have not found a solution for this: I have a Schema where I have several references to other Schemas: var mongoose = require('mongoose'...
asked by 23.01.2017 / 18:21
1
answer

Validate models with mongoose nodejs

I have my user model. // models/user.js var mongoose=require("mongoose"); var Schema=mongoose.Schema; var userSchema=new Schema({ name:{ type:String, required:"Es necesario un nombre", maxlength:[10,"Nombre muy larg...
asked by 24.09.2016 / 17:46
0
answers

Match user Schema with Client Schema on mongoose

good I am new working with node, and I am creating a user schema but I also have a client schema, and administrator, in the client schema (I leave the code below) I have the basic data like name, surname .. etc, and in the user's I have the emai...
asked by 02.01.2019 / 18:42
0
answers

geojson for MultiPoint with mongodb and nodejs

I have defined this Scheme: let capaSchema = new Schema({ nombrecapa: { type: String, required: [true, 'El nombre de la capa es necesario'] }, descripcion: { type: String, required: [false] }, geojson: Object([ geoSchema ])...
asked by 27.12.2018 / 23:00