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:...
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...
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...
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_...
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:...
for example the model is
var UserSchema = Schema({
firstName: {
type: String,
required: true
},
secondName: String,
lastName: {
type: String,
required: true
},
email: {
type: Stri...
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...
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...
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)...
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...