Most voted "mongodb" questions
Use this tag when the question refers to a resource, information, or problem that relates exclusively to the Nosql Mongodb database. Mongodb is a scalable, open source, high-performance, schematic, and document-oriented database that supports a large number of application development languages and platforms. Mongodb is recognized as the main Nosql database.
Learn more…587 questions
Sort by count of
-
0
votes1
answer103
viewsDate filter problem in C# (Mongodb)
I’m trying to filter between dates in C# on a table in Mongodb. Expected results should be between 19/11/2020 and 20/11/2020. This is my code on C#: collection.Find<Admissao>(x =>…
-
0
votes0
answers15
viewsSpring boot with Mongodb (Class _Accessor)
I have an API that uses Spring-boot and makes a recording in Mongodb. I was doing some local tests and I found that it has a class with high object allocation but wanted to understand where this…
-
0
votes0
answers16
viewsUpdating a subcollection on Mongodb
I have a Collection called purchase with various data, among them: const purchase = new Schema({ datePurchase:{type: Date, default: Date.now()}, ... products:[{ product: {type: String}, category:…
-
0
votes0
answers42
viewsreturn in the db form a field sum and also other collection values to include in the array
I want to create a query in mongodb where it returns the total value of all the houses of a certain type, and also which street of these houses. At the moment I’m just making a query that brings the…
-
0
votes0
answers7
viewsid captured in the request capturing the name of scripts files
The part of the route where the error is happening is this, the beginning of the controller is described like this module.exports.showOneCampground = async (req, res)=>{ const { id } =…
-
0
votes0
answers57
viewsMongodb Query in PHP Subdocument Index
I need a force. I have a Mongodb database with a document containing other documents, and I need to create a query in PHP from a key in that subdocument. Follows the structure. { "_id":…
-
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
votes1
answer23
viewsWith Docker running a different URL
I have an application running back end with Nestjs, Typeorm and Mongodb and my front end running React. I created a Docker container to run all applications but I have a problem. To run my local…
-
0
votes2
answers62
viewsI need to place coordinates from Mongodb on a map with reactJS
I’m creating a google maps heat map with reactjs, I was able to implement it and pass the coordinates manually, but I need to create the coordinates dynamically coming from the bank in Mongodb, on…
-
0
votes1
answer69
viewsAuthenticate mongodb with Docker
I’m starting studies with Docker and mongodb, I can’t authenticate, I would like to have a user and password for mongodb (container). If you can guide me how to create a user and password, I have to…
-
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
votes0
answers25
viewsMongodb Aggregate
have that collection: Students { "_id" : ObjectId("602fc88812985223d0f7ac5f"), "guardians" : [ { "_id" : ObjectId("602fc88812985223d0f7ac60") }, { "_id" : ObjectId("602fcb9a063fcb30d4017f8a") } ] },…
mongodbasked 3 years, 9 months ago joab henrique silveira 1 -
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
votes0
answers56
viewsUnreachable catch block for Unknownhostexception. This Exception is Never thrown from the Try statement body
Speak devs, all right? I am trying to connect Mongdb to a Java application and I get this error: Unreachable catch block for UnknownHostException. This exception is never thrown from the try…
-
0
votes1
answer29
viewsPHP with Mongodb - How to sign in to Mongodb and run command anyway?
I created a connection with mongodb and created a session from it: $manager = new MongoDB\Driver\Manager("mongodb://127.0.0.1:27017"); $sessao = $manager->startSession(); $id_sessao =…
-
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
votes1
answer24
viewsWith Javascript is it possible to automatically execute a function on another part of the file?
I have two separate pages: The first contains a form with two fields input of the kind date, among other information. The second page receives a data from the form information that I mentioned…
-
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
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
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
answers26
viewsHeroku Nodejs "Cannot GET"
I made a CRUD with Nodejs, Express, Handlebars and Mongodb - Works great in development, but when I try to make the Deploy in Heroku from the continuous error "Cannot GET /". I’ve researched a lot…
-
0
votes1
answer29
viewsRelationship 1:N mongoDB
I am creating a streaming application similar to Netflix and would like to know what would be the best way to treat "relationships" in Mongo. (I don’t know if using a bank in the QTS is the best…
-
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…
-
0
votes0
answers10
viewsNot operator does not work on typeorm
I am using typeorm in my Ode app and mongodb database. I have only one collection called "users" and have a route to get all users except me. So, here’s my code: const foundUsers = await…
-
-1
votes2
answers178
viewsHow to group dates according to month? Ruby + Mongoid
I own a class that contains events and their start dates. I need to retrieve all records by grouping them together so that the first days are listed each time. Example: 2014-01-01, 2014-02-01,…
-
-1
votes1
answer317
viewsSecurity in consultations with Redis and Mongodb and Nodejs
In the relational model, when using SQL we have to pay attention to SQL Injection in our application. At Redis and Mongodb, what precautions should I take when building a database query? Remembering…
-
-1
votes1
answer148
viewsMysql x Mongodb - Examples of Apps
Cite examples of applications, sites that would be best suited to use Mysql (or any other SGDB) or Mongodb. And the reason why? 'Cause I still can’t see scenarios where Mongodb is better..…
-
-1
votes2
answers1675
viewsError installing mongodb in windows
I tried to install the db Mongo in windows. I do the whole installation process but when the installation comes close to being finished the files and the installation folder of Mongo are deleted. An…
-
-1
votes1
answer99
viewsRemove documents embedded in Mongodb
I have a collection 'collection', with documents of the type: { 'autor':'Fulano', 'livros':[ {'Título':'Livro A','páginas':200}, {'Título':'Livro B','páginas':150}, {'Título':'Livro…
-
-1
votes1
answer592
viewsGenerate a PDF page using Java on the back and angular on the front
I would like the help of someone, I am developing a system using Java with Spring Boot framework, and Angular on the front, and I would like to generate a PDF with a predefined template, just…
-
-1
votes1
answer641
viewsHow to search all elements of an array in Mongodb
I have a Mongodb document as an example: { "_id": "andresm", "username": "Andre Salesmo", "carros": [ {"marca": "ferrari", "tipo": "coupe", "preco": "850000.00", "data_compra": "22/01/2015",…
-
-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
answer75
viewsintegrating php with mongoDB DB
I’m running a test to save the site information in the database and the code I wrote to see if the PHP and the bank are connected was that: <?php $mng = new…
-
-1
votes1
answer133
viewsHow to change the ip of Mongo for external access
Good currently I am using Mongo and React, and as usual the application works on 127.0.0.1 But now I also have an external access, so Ngo should also listen from another external ip. How do I make…
-
-1
votes1
answer62
viewsString to Json data conversion for Collections in mongodb
When I query a Collection in mongodb, it returns a field of the string type. [{"id":"1325","nome":produto1,"estoque":"10"}] But I need to make this field a Json. It is possible to do this in the…
-
-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
answer120
viewsMongodb query returns empty array
I have a route that receives a parameter in the format yyyy-mm(year-mes), I get this in the function below and do a search in my mongoDB database, but returns []: const findYearMonth = async (req,…
-
-1
votes1
answer189
viewsI cannot run the mongoDB server
I’m new to mongoDB, so I don’t know how to fix this. OS: Windows 7 follow the command: C:\Users\Rodrigo>mongod and the error obtained: 2018-03-21T16:09:27.837-0300 I CONTROL [main]…
mongodbasked 6 years, 8 months ago rodrigox bragahz 59 -
-1
votes1
answer122
viewsHow to use Mongodb 'Regex' filter in PHP
I have made some attempts following examples on the internet, I found some until there seems to be a mix of the two versions of the driver Currently, in the Mongodb bank I have a structure similar…
-
-1
votes1
answer74
views -
-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
votes1
answer33
viewsMongodb - data divergence problem in Aggregation
I’m making a agreggation in collect pedidos where at the end I make a group to count how many pedidos has every status. So far, so good... Only when I put it on match looking for a status specific…
mongodbasked 5 years, 5 months ago Andrew Rodrigues Brunoro 1 -
-1
votes1
answer74
viewsGET method does not access data in mongoDB
I created schema.js to consume data from a small database in Mongodb const Mongoose = require('Mongoosis'); //create schema var Schema = mongoose.Schema; var restorationSchema = new Schema({…