Most voted "mongoose" questions
Mongoose is a Mongodb object modeling tool, or ODM (Object Document Mapper), written in Javascript and designed to work in an asynchronous environment.
Learn more…189 questions
Sort by count of
-
0
votes2
answers368
viewsHow to take data from a specific field in an XML,with Nodejs,and then save it in the Mongo database
In an API response, it brings me an XML, but I need to capture just a few specific fields and save it in my database Mongodb with the package Mongoose,using Nodejs and Axios. My XML response comes…
-
0
votes0
answers130
viewsMongoparseerror: Invalid Connection string Express+Mongo
I’m using for the first time the express and the Mongo, it works normally locally, no authentication, but when I went to cloud, in the Umbler hosting it started to show error Jan 07 14:05:19 } Jan…
-
0
votes1
answer130
viewsUpdate only in fields that have content other than null - Node with Mongoose
I have a question about giving update using Mongoose. I already have the route done and working, only I’m having a problem. So I’ve unstructured all the data I’m going to take from req.body, then…
-
0
votes0
answers36
views -
0
votes0
answers26
viewsHelp with paging with Express-Handlebars and Mongoose
I’m using the Express-Handlebars and the Mongoose, I want to make a page, I think I got the code on the model, but I got lost in time to pass it to the handlebars and then, I decided to come here.…
-
0
votes0
answers96
viewsPersist json file information in Database
I would like some help with a question related to nodejs. I am trying to save information I receive from a local json file to the database. this file brings me several objects, and what I need to do…
-
0
votes1
answer62
viewsHow popular is an object loaded with populate in Mongoose?
I have a doubt, if I already have a query being populated in Mongoose, and it is populated with a model that also has relationship, there is a way to popular it too? For example: I have my model of…
-
0
votes0
answers21
viewsMongoose - Filter by foreign ownership
Good afternoon, I need to know how to do it, using Mongoose, to filter a model from a foreign property. For example: const Usuario = new Schema ({ nome: { type: String, required: true }, cargo: {…
-
0
votes1
answer193
viewsMongodb - change object value within object array
I have a Collection in mongodb called users containing the field (which is an array of objects) adress. I have the following piece of code to replace and change in the database: async…
-
0
votes1
answer73
viewsReferences with Mongoosis
I currently have 3 Collections in my project, and I need 2 of them ("Course" and "Lesson"), have a link, I want when adding a "Lesson" it to be inserted in a "Course" through a push, but is giving…
-
0
votes0
answers22
viewsMongoose finds but does not update the document
I am using Mongoose in my code and can’t update documents, but with mongodb it works normally, whenever I try to update a document, it returns the following results and does not update the document:…
-
0
votes0
answers26
viewsMongodb referencing data from another Collection
Hello, I have a Collection "posts" that when creating a new document, along with the post data goes the ID of the user who created it, as well as the name of the user and image url. But I realized…
-
0
votes0
answers21
viewsMongoose Populate - Return specific data
I am using populate to return data from the user who created a post. It works well, the problem is that populate returns the entire user, including password hash and other information, but I only…
-
0
votes2
answers35
viewsI cannot return the requested amount ( Mongodb )
I’m trying to make a list of names of people who are registered in my database, and print on the web The model I’m using is this const mongoose = require('../../database/conn') const bcrypt =…
-
0
votes1
answer23
viewsUpdate array specific positions using mongodb with or without Mongoose!
I have the following situation! const meuModel = new mongoose.Schema({ nome: { type: String, required: [true, 'Nome'] }, links:{type : Array,}, }) Links is an array of objects! links [{url:link,…
-
0
votes0
answers13
viewsMongodb (Mongoose) does not update properties of an object array type document
I have a 'document' of users that has a tag field of type Array that receives objects, these objects are posting tags that store all tags used by it and the amount of repetitions. The problem is…
-
0
votes0
answers18
viewsUse $in and $gte together - Mongodb
I am developing an order system(type Ifood - from deepweb haha) I have 2 models, one of requests(fields: user information and a subdocument with the products) and another of the products. When the…
-
-1
votes1
answer102
viewsError query Mongoose
I have an appointment at Nodejs with Mongodb: filter:['abertos','cancelados']; schemas.chamados .find({STATUS_CHAMADO : {"$in" : filter}}) .exec(function(err, dados) { if(err) return callback(err);…
-
-1
votes1
answer123
viewsMEAN STACK: Mongoose model blocks communication with my controller
Man controller does not send data to my router when mine Model is being exported in the application and I don’t know why it happens. controller js. var Model = require('../models/dado.js');…
-
-1
votes1
answer20
viewsNodejs + Moongose + Typescript
I’m new to development with Nodejs and I’m having a problem. I have an Array of an obj whose Id is type Objectid from Mongo. I’m trying to make a find inside this Array by searching for that Id. And…
-
-1
votes1
answer59
viewsI need to associate variable to a key of the NODEJS object
I am finding in the database the correct seller, however when I try to associate the sellerSupport variable to the value of the support object within the user, it Undefined me and I cannot associate…
-
-1
votes1
answer31
viewsProblem capturing object value
I’m doing a database search (mongoDB) so it returns me an array, I just wanted to be picking up an array object but I’m not getting it. app.get("/", (req, res)=>{ Gift.find().lean().then(gifts…
-
-1
votes1
answer27
viewsBehavior of the Variable this in Validation with Mongoose + Nodejs
I’m trying to run a validation process for a field in the Mongoose schema. However, the behavior of the variable "this" is different than expected. Because according to the documentation in:…
-
-1
votes1
answer2627
viewsHow to work with Date & Time in Nodejs, Mongoose and Typescript
Good morning, you guys, I come from the Java world and am starting in Nodejs. I’m having a hard time understanding how to work with dates and times at Nodejs. This is an example of the model I want…
-
-1
votes1
answer240
viewsRequest returning Cannot PUT with express
Greetings dev’s my route file is like this: const express = require('express') const routes = express.Router() const TodoController = require('./controllers/TodoController') ...…
-
-1
votes2
answers89
viewshow to use the cursor in the mouse
when I will make the requisition to take the amounts of debts and credit of this error: { "errors": [ { "name": "MongoError", "message": "The 'cursor' option is required, except for aggregate with…
-
-1
votes1
answer87
viewsError while creating user
I am having the following error when trying to create a user in my api Validationerror: address.0.status: Path estado is required. , Address.0.city: Path cidade is required. ,…
-
-1
votes1
answer420
viewsHow can I search between dates with nodejs and mongodb?
I would like to know how I can search between dates. Example: Bring all data between 06/12/2018 to 06/11/2019. Bring all data for a given year or month. How can I make these filters in my controller…
-
-1
votes1
answer684
viewsQuery with conditions using Mongodb Irrigation + nodejs
I have a code that returns me arrays with the parameters I need to feed my HTML page, however, I need to include some conditions in this search so that it only takes the values after a certain date.…
-
-1
votes1
answer223
viewsHow to create a search box with Nodejs and Mongodb?
I am trying to create a search with mongodb using "like" according to this site this site https://bognarjunior.wordpress.com/2015/05/18/consultas-avancadas-com-mongodb/ var results = await…
-
-1
votes1
answer54
viewsFind at least one result within a mongoDB array
I would like to return the user posts if they have at least one of the tags similar to the post For example: User tags ["react","c#","node"] Post tags ["c#","sqlserver","asp.net"] How the user has…
-
-1
votes3
answers51
viewsHow to exit the condition loop in this register with Mongoose/Express
I was learning how to connect my API to a database using Mongodb, so I started learning how to register users and everything was going fine until I got caught up in a problem that’s keeping me from…
-
-1
votes1
answer60
viewsHow to display text coming from mongodb (Mongoose) with line breaks correctly?
Good afternoon. I’m a beginner and am implementing a blog using Nodejs + Express + Mongodb (Mongoose). I realized that when I create a new post, the same one, when viewed, does not show line breaks…
-
-1
votes1
answer78
viewsMongoerror: Authentication failed. Mongoose
I am running an application Node and mongodb Docker on my machine, but when I try to connect to the bank using moogose returns: MongoError: Authentication failed. at MessageStream.messageHandler…
-
-1
votes1
answer40
viewsWhy does Mongodb (nodejs + Mongoose) not update object property of a document?
I have a document (Mongodb data) from user who has a field tags that stores the tags already used by the user. It is an object array in the format {text: 'tag1', count: 0}. The problem is when…
-
-2
votes2
answers39
viewsHow to save a dice with mongosis
Good afternoon. I would like to know how to save a data in mongodb, because I tried a method and it worked, now I’m trying the same in another function and it’s not working. Thanks for the help…
-
-2
votes1
answer888
viewsError trying to post on Mongodb with Insomnia
Hello, I am trying to insert a data in the database (Mongodb)using the POST type, I am using Insomnia to perform the inserts tests but when I try I get a return of errors by the nodejs terminal, as…
-
-2
votes2
answers1139
viewsUnhandledpromiserejectionwarning - Registration Error with Mongodb and Node.js
I’m trying to register users on Mongodb. The environment is windws 8.1 and I am also using Mongoose, express and Xios in the backend and Insomnia to test the registration. When I try to register…
-
-2
votes1
answer55
viewsMongodb field autoincrement (not ID)
Hello, I have difficulty using an auto-increment function in a numeric field on Mongodb (is not ID). The code is in nodejs with Mongoosis and no use plugin Mongoose-autosequence etc. The structure…