I am new with this framework and I was trying to do a 'Registration and Login' test with PassportJS + Express + Node.js + MongoDB and Redis. The registry works perfectly and apparently the login also, the problem is that when logging in I want t...
I do not know why the value is not assigned to the variable amount . Thanks
var mongoose = require('mongoose');
const bodyParser = require('body-parser');
var menuModel = mongoose.model('menu');
var reservationSchema = new mongoose.Schema(...
Good morning:
I start from the following scheme:
var schema = new Schema({
id: {
type: ObjectId
},
title: {
type: String,
required: [true, 'Title required']
},
students:[{
id : ObjectId,...
Greetings community.! I'm making a small application using node and
mongoose and I want to update a specific field of a document ie:
I have a document called Libro with a property ejemplares_disponibles of type...
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...
I'm trying to make a query in mongoose and I can not think of how to put it together.
In SQL it would be something like this:
SELECT * FROM MATERIAS
WHERE
activo = true AND
nivel = $nivel_id AND
(alldisc = true OR disciplina =...
Hi, I'm running a final project in Heroku using MongoLab and Multer to upload photos, it seems to work fine, but after a few hours or less the photos disappear from the page, but leave the img placeholder, the symbol appears when the browser can...
I have an error that sends me postman
Product is not a function
My code in nodejs is as follows
'use strict'
const express = require("express"),
bodyParser = require("body-parser"),
mongoose = require("mongoose")
const...
Suppose I have a database in mongodb, in which I can store some information with .save () but now, I want to retrieve that information and pass it to the client, for which I use findOne () to acquire the desired data , that data I want to pass t...
PS: Apart from the info below, here is the source: link
The question is, why can not I access "User" which is a model for mongoose from a route?
That's how I have the router.
As you can see, User gives me an error "Can not fin...