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
-
1
votes1
answer441
viewsDocker-Compose Spring boo and Mongodb: Connection Refused
I’m studying Docker, and I’m trying to run a small application made in Springboot along with Mongodb in a single container. I wrote the following Dockerfile: FROM openjdk:8-jre-alpine ENV…
-
1
votes1
answer604
viewsHow to integrate and make queries with pymongo?
I am learning to integrate Python and Mongodb and, because of that, I proposed a challenge: create a small program to register football players. My program has two modules, info_player and…
-
1
votes0
answers294
viewsGraphics using Chartjs, Mongodb and Angular
Good evening, I have the following model: var mongoose = require('mongoose'); module.exports = function() { var schema = mongoose.Schema({ nome: { type: String, required: true }, valor: { type:…
-
1
votes1
answer62
viewsWhy is the POST not working on my Mongodb?
Whenever I execute the post command the Inuit returns me an empty User. router.post('/register', async (req,res) => { const { email } = req.body; try { if (await User.findOne({ email })) return…
-
1
votes1
answer123
viewsProblem registering objects nested in Mongodb with Mongoose
I have the following collection: // SUSPEITOS - INICIO // const suspeitosSchema = new mongoose.Schema({ nome: { type: String }, sexo: { type: String }, corPele: { type: String }, altura: { type:…
-
1
votes1
answer94
viewsMongodb in Azure
A while ago I had an unpleasant surprise on my Azure invoice on account of a Mongodb database that I owned for access to an application. I created, for example, the documents: Client Product Request…
-
1
votes2
answers427
viewsHow to give a disabled in a form depending on which radio button to choose?
Good afternoon... I have the following radio Buttons: <input type="radio" name="radio1" value="entrada"> Entrada <input type="radio" name="radio1" value="saida"> Saida I also have the…
-
1
votes1
answer82
viewsView data by clicking a link from the Mongo database
Guys, I have the following situation! I have a list of entries saved in my Mongo bank, I need to display the list thing I’ve already done and when clicking on the product would open a screen with…
-
1
votes1
answer19
viewsMongodb driver C# Index not used
In Mongodb: db.estr.createIndex({_id:1, Atualizar:-1}); In C# var a = await db.dados.Distinct(x=>x.codigo).toListAsync(); var b = await db.estr.find(x=>!a.contains(x._id) &&…
-
1
votes0
answers161
viewsAdd a Document to an Array in Mongodb
This week, I started messing with Mongodb (I’ve never had much contact with any DB before) and a question just came up that I’m not able to solve(I researched, believe me). Let’s go to the following…
-
1
votes0
answers27
viewsHow to generate Factory Boy Fuzzy Attribute before running each test?
I am creating unit tests to perform integration tests of my web application. The tools I am using are: Mongomock to create a temporary bank instance for testing and Factory Boy to create mock…
-
1
votes1
answer71
viewsWhat is Mongodb and why should I, as a front-end dev, adopt it instead of good old Mysql?
I have heard comments from other devs to migrate to Mongodb to create my applications. How and why I should do this? There is an interface by which I can manipulate the data, etc.?…
-
1
votes0
answers10
viewsConvert SQL to Mongodb
--Personal Peco helps to convert the following sql query to mongodb: select count(*) FROM tabela Where ((DataFim - DataInicio ) /1000 /60 /60) is not null and ((DataFim - DataInicio ) /1000 /60 /60)…
-
1
votes1
answer118
viewsHow to reverse the $unwind operation on Mongodb 3.4?
Imagine a collection of products: db.produtos.find() [ { _id: "produto01", cores: ["preto", "branco", "ouro"] }, { _id: "produto02", cores: ["branco", "ouro"] } ] Each product has a field called…
-
1
votes1
answer64
viewsThe updateOne function is not working, returns me OK, but does not change anything
I am using Mongodb to do data persistence in my application, with Nodejs. I make the call like this: module.exports = function (app) { var dbConfig = app.config.db; return { changeAccountStatus:…
-
1
votes1
answer34
viewsError when doing Aggregate command with Mongodb $geoNear
I own a collection calling for location with the following data: { _id: ObjectId("5a900f4af1b7fd855010c0cf"), car_id: ObjectId("5a85c26a35fdcf1098c23480"), location: { type:"Point",…
mongodbasked 6 years, 11 months ago Ingo Guilherme Both Eyng 119 -
1
votes1
answer83
viewsMongodb Objectid returning [Object Object] in Ajax
In a query I do in Mongodb using Ajax and PHP, when I manipulate Objectid already in javascript, it returns me as [Object Object]. How do I use it as a string? It follows code $.ajax() $.ajax({ url:…
-
1
votes1
answer67
viewsHow to create a jquery object and insert it into mongodb via ajax?
I have the following structure in html: <form id="titulo"> <input type="text" name="nome"> </form> <form id="turno1"> <div class="linha"> <input type="text"…
-
1
votes0
answers60
viewsSearch for registration in Mongo and update
I need some help to make a update in a specific record. Below is the document I want to change. { "_id":"ddc07497-003d-3dff-8f82-24b9b980a568", "date":"2018-04-19T17:14:29.699Z", "messages":[ {…
-
1
votes1
answer706
viewsThe `useMongoClient` option is no longer necessary in Mongoose 5.x, Please remove it
I tried to connect to the bank using these settings; 'use strict' var mongoose = require('mongoose'); mongoose.Promise = global.Promise; mongoose.connect('mongodb://127.0.0.1:27017/ep', {…
-
1
votes1
answer63
viewsCrud with Mongodb and C# error in type or namespace
Accompanying a Macoratti tutorial here, errors appear in three types. I don’t know what to add to solve. I Copy and Paste and gave error. Below the code: using MongoDB.Driver; using System; using…
-
1
votes1
answer293
viewsAdd document subdocuments - Mongoose
Good evening! I have the following document: { "_id" : ObjectId("5b21a4332a5e3333cc64a12f"), "nome" : "João", "sobrenome" : "Barbosa", "cpf" : "12345678910", "senha" : "Fabet@1010", "viagem" : [ {…
-
1
votes1
answer320
viewsPost by Postman is giving error of Object Reference not set to an instance of an Object
I understand that the Frombody is coming null and I don’t know why. That’s my Postman payload { "ChannelCode" : "TS", "Name" : "Teste", "Celphone" : "(11)999999999", "Endpoint" : "www.teste.com.br",…
-
1
votes1
answer439
viewsHow to return an object from a bank in QTL(Mongodb)?
I currently have some objects in a Mongodb database. The structure is as follows. { "_id" : ObjectId("55cb9c666c522cafdb053a68"), "geometry" : { "type" : "Polygon", "coordinates" : [ [ […
-
1
votes1
answer647
viewsHow to insert equal objects or list of objects in Mongodb?
Example, I have the following JSON: { Casa:'b32', integrantes:{ pessoa: 'joao', pessoa: 'Maria', pessoa: 'Daniel' } } When you enter it into the database it looks like this. Apparently it is…
-
1
votes1
answer82
viewsHow to control filters for a query that persists in mongodb
I have this query in my api: @Query("{$and: [" + "{'online': ?5}, " + "{'locations.appointmentTimeRanges.weekday': ?6}, " + "{'specialties.name': ?7}, " + "{'healthInsurances.name' : ?8}" + "]}") I…
-
1
votes1
answer554
viewsHow to create a field that references a sub-array of a Collection in Mongoose?
Imagining the following structure(Merely illustrative example): Collection: Schools [ { "_id":"abc123", "nomeEscola":"escola1", "turmas":{ "_id":"ccc333", "nomeTurma":"Turma1" } }, { "_id":"abc122",…
-
1
votes1
answer107
viewsUpdate of an index of an array of a Mongodb document
Guys, I would like to know how to update a document value that is inside an array. See the document: > db.alunos.find().pretty() { "_id" : ObjectId("5ba141b186b9fc17121423a1"), "nome" : "Diego",…
mongodbasked 6 years, 4 months ago Diego Armando Cacilha 97 -
1
votes2
answers70
viewsError passing JSON arguments
I am trying to make an insertion in Mongodb passing some arguments in JSON: { "name": "TESTE", "category": "B", "service": "Novo processo", "description": "Novo Teste", "active": false,…
-
1
votes1
answer460
viewsnodejs + Mongoose how do for one query need another?
I have two tables they have a link id being table A(Initial) tableB(dependencies) however there may be dependencies. I’d like you to just return in the dependency sequence. function Deps(dt) {…
-
1
votes1
answer150
viewsMultiple applications consuming the same database
Today I have an application that uses a database (Mongodb), but I have few users yet and as we know it is very difficult to have an application that is successful and accumulates many users.…
-
1
votes1
answer206
viewsHow to use the value of a variable to define an object key?
I wanted to return a Mongodb JSON with some filters, the problem is, when I try to pass a variable through the function, it doesn’t work, this is the code: async find(req, res) { const { filter,…
-
1
votes2
answers97
viewsUse updatemany in Mongoose in a request
I’m trying to make a update/Insert with the Mongoosis when finalizing a request. This request returns to me, for example: let obj = [ {nome: aaa,idade: 10}, {nome: bbb,idade: 11}, {nome: ccc,idade:…
-
1
votes1
answer100
viewsSimplify foreach to update a mongoDB doc that has nested objects and arrays
I want to update the value of the 'shouldSendAlert' key in a mongoDB document that is in the following structure: { "_id" : ObjectId("5c61c4db46d18e1092c5b024"), "service" : "SRVPVD", "menu" : [ {…
-
1
votes0
answers45
viewsMongoclient returns empty when selecting a Collection
I’m using the Mongodb Atlas with bank,and the Mongodbdriver to make the connection, but when selecting my Collection it returns empty instead of returning the collection data. My connection: class…
-
1
votes0
answers20
viewsHow to aggregate in mongodb via a Repository in javascript/Node?
I have a repository that makes a query in the collection logsMonitrip. The method below is called by the service when the user tries to make a query through the company’s cnpj, after that I get the…
-
1
votes1
answer275
viewsFind(ID) of Mongo returns nothing
I have a collection called users on Mongo with approximately 1000 values. Access Mongo through Mongodb . NET Driver, at the moment everything works normally. But these past few days I’ve been…
-
1
votes1
answer36
viewsQuery in Embedded Document
I’m trying to make a query to return only bank 1 investments that are not savings. How do I do? I have tried several ways and it has not worked so far. I followed the following query:…
-
1
votes0
answers116
viewsPytho Kafka, Spark Streaming, Mongodb conection
Hello I am creating a job streaming, but I do not get error message and nor does recording in Mongo. I have tried several types of connection. On the command line, Producer and Consumer can produce…
-
1
votes1
answer218
viewsError picking up input from a <form> with Mongoose/nodejs
Hello, I recently started learning Node.js and I’m using Mongoose to integrate with db 'mongodb', and in this application I’m trying to take data of 2 and insert this data into the database, I made…
-
1
votes1
answer229
viewsHow is the pymongo connection established?
I’m building a program that scans a database every minute, and if some conditions are met, the program makes several requests via Apis and talks to Mongodb to process and save the data. It is very…
-
1
votes1
answer383
viewsMongoose is updating wrong object in mongodb
I have a problem saving the data in mongodb. Context I have an express api that listens to requests to save the data to the mongodb an application sends. This data is related to APP page views,…
-
1
votes0
answers559
viewsHow to use "import" properly in a Node.js application with typescript
Good afternoon. I am writing a Rest API using node.js and typescript, but I’m having trouble using the import in some parts of the programme. for example in my server.ts I have: const connectDB =…
-
1
votes1
answer206
viewsHow to show number of pages in handlebars paging?
This is my code to calculate the number of pages, here is calculating everything correctly, already tested. app.get("/page/:page", (req, res) => { var perPage = 3 , page = Math.max(0,…
-
1
votes0
answers272
viewsError accessing Rstudio 127.0.0.1
I’m trying to access Rstudio and this error appears: 127.0.0.1 refused to connect. Try: Check the connection Check proxy and firewall ERR_CONNECTION_REFUSED if I go in cmd and der ping: C: Windows…
-
1
votes0
answers32
viewsMongoose Always returning an Empty array Nodejs
I’m using only find() on my server to Try to Retrieve data from Mongodb with Mongoose, but it retriveis this "{}", and on the console "Array(0) []" js router. const Teams = require('./models/map');…
-
1
votes1
answer106
viewsTrying to get data from the Mongodb bank
Guys I want to create a function that returns an array of my database collection, but I need to do this using mongoDB native drive, without Mongoose, I would like some tips. I already have a code,…
-
1
votes1
answer129
viewsProblem trying to connect Mongodb via Docker-Compose with Robo3t. How to complete the connection?
I want to make a connection through Robo3t of a Mongodb database that is running via Docker-Compose. version: '3' services: mongo-express: image: mongo-express container_name: mongo-express ports: -…
-
1
votes1
answer174
viewsQuery in array with mongodb
Good afternoon friends, I searched how to make a find inside an array in mongodb, looked at the documentation and so far in the forum and got no answer for my doubt. my array it does not contain…
-
1
votes1
answer31
viewsMongo BD timeout with Aspnetcore hosted on the smarterasp server
I have a web api on Asp Net Core performing reading on a non-relational basis on Mongo DB. Running the application locally with the connection pointed to the Atlas Mongo DB server works perfectly,…