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
-
2
votes1
answer132
viewsWhat are the best practices for putting mongoDB into production?
I am studying Ode.js, and in most courses the staff uses mongoDB, I really enjoyed working with it, very simple and practical, but I have some questions: Nowadays, most hostels already support…
-
2
votes1
answer927
viewsRead row by row from file . txt
I am trying to read a file . txt from 3.5GB line to line and save to Mongo db. The columns use the "|" tab and I am using Node js with Express. I did the test with a file smaller than 43 lines and…
-
2
votes0
answers33
viewsi wanted to make a query that returns me the following data in mongodb
COLECTION GAMES { id : 10, casa : "Sport", visitante : "Chapecoense", horario : "2017-07-20 11:00:00" } GAMBLER COLLECTION { nome : "wedson", apostas : [ { idjogo : 10, opcao : 1, valores : 1 } ] }…
-
2
votes1
answer383
viewsHow to use data from a query in mongoDB?
I want to use the data that return from Mongodb’s 'find()' to, through a foreach, create a table using the array that returns from Mongodb, and after the table is ready, generate a PDF, but I am not…
-
2
votes1
answer232
viewsMongodb seeks to return internal arrays
Example of structure: { "_id" : ObjectId("598d4eb912f28534d80a5820"), "nome" : "Emilio", "produtos" : [ { "_id" : ObjectId("598d4fb912f28534d80a5821"), "nome" : "produto1" }, { "_id" :…
-
2
votes3
answers8565
viewsCompare 2 arrays and save the difference between them in the database?
I have 2 object arrays, one of them is composed of emails that comes from the provider through IMAP protocol and I convert to objects and then put in an array all of it. The other is an array of…
-
2
votes1
answer900
viewsUsing model.find() with LIKE in Mongoose
I have a function here to do a search on Mongodb using Mongoose, but I would like him to find Brazil when I searched for bra, Bra, Sil, Sil, etc. I looked in the documentation and followed the…
-
2
votes1
answer185
viewsPass variable in Mongodb query (JAVASCRIPT)
With that consultation: const result = await Topic.find( { 'categorieName': { $regex: /^news/i } } ) I can return the categories with name news, the problem is that it is not always news, so I…
-
2
votes1
answer237
viewsHow to update a document within another document without deleting previous data in Mongodb?
Actually, I have two questions: Imagine a collection livro structured: { "Título" : "MongoDB para iniciantes", "Tags" : [ "MongoDB", "NoSQL" ], "Comentários" : [ { "Comentarista" : "Ana",…
-
2
votes1
answer30
views$sum returning value 0
I created the database and fill in a 'stock' collection as in the attached figure. I was trying to make the sum of the quantity of items in the stock, but Mongo only returns me the value 0 (zero). I…
-
2
votes2
answers4055
viewsWhat’s the best way to save an image on Mongodb?
I am developing a JS system with Node server and need to save images in Mongodb in a way that saves as much space as possible, and I am currently converting the image to String Base64 and saving as…
-
2
votes1
answer3054
viewsNodejs / Mongodb: Deprecationwarning: Current URL string parser is deprecated, and will be Removed in a Future version
I’m in trouble in: let options = 'replicaSet=XPTO&readPreference=secondary'; var url = `mongodb://${user}:${password}@${host}/admin?${options}`; Deprecationwarning: Current URL string parser is…
-
2
votes2
answers142
viewsDocker: Problem using container IP
Hello, All right? Before long I learned to use Docker and decided to practice the use of mysql and adminer, with the following Docker-Compose I already had the containers standing. version: '3.5'…
-
2
votes1
answer75
viewsDistinct and group in Mongodb
I have this query: db.getCollection('lojasDisponiveis').aggregate( [ { $group: { _id: { codigosLojas: "$codigosLojas", codigoUrl: "$codigoUrl" }}} ] ); The problem: For each store or group of…
-
2
votes1
answer584
viewsHow to add values by category?
I have some data structured as follows: "_id" : "", "filmes" : [ { "nome" : "Filme 1", "categoria" : "terror", "qtd" : 7 }, { "nome" : "Filme 2", "categoria" : "comedia", "qtd" : 7 }, { "nome" :…
mongodbasked 6 years, 10 months ago WindsBrain 31 -
2
votes2
answers786
viewsHigh demand stock control with Firebird and/or mongodb
I’m thinking of migrating my ERP (currently in java) from a relational database (currently in Firebird) to a Nosql (probably Mongodb). I am planning and trying to anticipate the possible problems.…
-
2
votes1
answer1339
viewsHow to relate two "models" to Mongoosis?
I have two models in my comic book user js. var mongoose = require('mongoose'); var Schema = mongoose.Schema; var bcrypt = require('bcrypt'); // User Model var UserSchema = new Schema({ name: {…
-
2
votes1
answer94
viewsHow to do Mongo inserts?
I’m doing a program that will perform numerous insertions in Mongo (about 500,000). But I noticed doing some tests, that the more entries in Mongo I have, the longer is the insertion. My code: def…
-
2
votes1
answer164
viewsMongodb - How to insert an Objectid via variable?
I’m learning MongoDB and a problem came up, I’m trying to insert an Objectid into an array via variable, but I’m not getting it. I’m doing it this way: > var aluno = db.alunos.find({"nome" :…
mongodbasked 6 years, 7 months ago Leandro Souza 75 -
2
votes1
answer2626
viewsHow to get a URL parameter in Express?
My URL is coming this way http://localhost:3000/menus/5.5 and it’s bringing all the 5.5 records, but I wish the URL could look like this http://localhost:3000/menus?price=5.5 to have the same…
-
2
votes1
answer69
viewsUpdate on mongoDB is deleting the rest of the document
I have a collection structured like this: { "_id": i43h21n5lk2354, "createdAt" : ISODate("2018-08-19T16:56:31.555Z"), "services" : { "facebook" : { .... name: "Michael Jackson" .... .... } I want to…
-
2
votes2
answers68
viewsMongodb Agregation + Lookup
Good evening, I need to relate two collections in mongodb, are they: db.markets db products. db.mercados.find() { "_id": ObjectId("5bb90160995e46f1fdbf1fe8"), "nome_mercado": "teste", "localidade":…
mongodbasked 6 years, 1 month ago Oseias Beu 21 -
2
votes1
answer42
viewsSearch in Index on Mongodb returning non-existent words, 'Bed' do you think 'Camera'?
Hello I am new in this database and I have made the following index for my documents: produtos.create_index([('Tags', pymongo.TEXT)], unique=False, sparse=True,name='tags',…
-
2
votes0
answers103
viewsAdd Object Array Subdocument Reactjs and Mongodb
Sirs, Kindly help me with this doubt? Summary: I’m creating a mini app using Node/Mongo/React. This app uses relationship in Mongo and would like help to add data via frontend(reactjs) to the array…
-
2
votes1
answer106
viewsAdding multiple IDS within an array?
const [pergunta, setAddPergunta] = useState([]) async function pegarId(_id) {setAddPergunta(_id) console.log(_id)} <tbody> {getPerg.map((pe, i) => ( <tr key={i}> <th…
-
2
votes3
answers120
viewsProblem with javascript filter in various JSON
I’m trying to capture a certain product for your ID using the filter but there are some problems. It is only returning an empty array. The products are stored within Categories, that is, there is an…
-
2
votes1
answer455
viewsFlutter does not return images from api
I’m trying to get the images from mongodb database, via api I did in nodejs, but it doesn’t work at all, and still presents this error here. Invalid argument(s): No host specified in URI…
-
2
votes0
answers20
viewsMongodb collections
I have a database in Mongo with the following collections "Productsservices" and "stock" where the stock collection will inform the stock value of a record within the product and service collection…
-
2
votes1
answer155
viewsAxios: stop in GET does not work - React Native
I have a database in Mongo with customers and establishments. I want to recover the establishments filtered by category. My code is like this: const [datas, setDatas] = useState([]) //recupera os…
-
2
votes1
answer47
viewsHow do I make the user repository use the extends property?
I’m trying to make a generic repository, I’m using Mongodb for that, I tried to import it and use it with the property extends other classes, but did not succeed. What I need is to make the class…
-
2
votes1
answer62
viewsfindByIdAndUpdate() is creating document instead of updating
I am crud using Node, Express and Mongodb, but I have a problem with the update operation when using the findByIdAndUpdate() Mongoose it is not updating the document but creating a new.…
-
2
votes1
answer27
viewsMongodb not recognizing command when someone writes something in front
I have a bot and saved its commands in the Mongodb database, but when I write, for example, "! command and other things on a line" it does not answer, how could it ignore these other words? My code…
-
2
votes0
answers23
viewsHow to update a subdocument in a mongoDB document with Findoneandupdateasync
I’m trying to add a subdocument to a mongoDb document, but even looking at the previous posts I couldn’t find a solution. My classes public class UserClass { [BsonId]…
-
1
votes2
answers333
viewsQuery using Mongoose in Nodejs always returns null even within asynchronous method
I am trying to recover a document in my Database using Mongoose in Node.js but it always returns Null. My problem before was the asynchronous method, but now everything is running within it. And I’m…
-
1
votes1
answer132
viewsMongodb and Redis on the same server
I am planning a system that uses Mongodb for reading data and Redis for session sharing between PHP and Nodejs. Is there any problem having Redis and Mongodb running on the same server, since both…
-
1
votes0
answers174
viewsWebsql, Mongodb or Sqlite3, advantages/disadvantages of each when used with Phonegap?
Considering the use in Phonegap what are the advantages/disadvantages of each.
-
1
votes1
answer1283
viewsSum of Nodejs + Mongoose values
I need to sum the values stored in a variable in the bank. I have a form and want to know the total value generated in a variable. So I did it this way: _.each(cliente.data, function (data) {…
-
1
votes0
answers67
viewsMongodb - Error while trying to show server startup warnings: no such cmd
I installed some of the versions of mongodb on a Macbook with Yosemite 10.10.2 and both using the Homebrew and manually installing all gave the same error, except the 1.4.4 which is very old, has…
mongodbasked 9 years, 8 months ago Adrian Miranda 11 -
1
votes0
answers106
viewsAggregate with Sort - Mongodb
I have a query in Mongodb, I do Aggregate to count how many items there are in each category, everything works well, however I can’t sort the data, that would be ordered by the Title field. Follow…
-
1
votes2
answers250
viewsSum number of records per year and month
I need to generate a Json file that will feed a graph. I need to load the following information. I have a form that receives date(dd/mm/yyyy). My chart shows the number of registered visits per year…
-
1
votes0
answers79
viewsPerformance php + mongodb + Graphics
Good morning wonderful people, I am beginner in development and I have an issue that has taken my sleep, I am testing a system in php with mongoDB database, in which is generated a graph with…
-
1
votes1
answer794
viewsReference collections in mongodb
I have a model of an airport in mysql and I intend to upload it to mongodb via links between collections. In the following images are examples of documents from my collections. (Airplane, Airport…
-
1
votes1
answer112
viewsHelp with the Mongoosis
Not understanding what happened: ready = function() { groups = mongoose.model('groups', schemas.group); groups.find({}, function(err, docs){ for(i in docs){ console.log(docs[i].name); } return docs;…
-
1
votes1
answer2484
viewsMongodb query and return array specific elements within objects
Guys, I need a help to query certain values in a document. I have a collection in Mongo that follows this structure, including this is the document I can and need to locate:…
-
1
votes1
answer319
viewsMongodb extension not found in PHP 5.6
I am developing an application in PHP 5.6 with Laravel 5.2 using Mongodb. The problem arose when I decided to upgrade my Mac to El Captam in a clean installation, because when I installed PHP 5.6…
-
1
votes0
answers96
viewsMean Stack Running the first project
Good afternoon guys, I’m trying to run the Mean stack on my machine (Ubuntu 14.04, 64bits), I followed the step by step site and apparently everything went well when I run the cameo on the ternimal…
-
1
votes1
answer160
viewsHow to save php session in Mongodb and recover data in Nodejs
I’m running a server on php and another in nodejs trying to get a simple authentication since every session runs in php and nodejs simply processes some events however, and required authentication…
-
1
votes0
answers41
viewsDoubt with Findone in Angularjs using Mongojs error at search time
Hello I am trying to make a search in the bank with this code using the findOne of mongojs, follows code: app.get('/detalhesContato/:id', function(req, res){ var id = req.params.id; console.log(id);…
-
1
votes0
answers151
viewsReactive Programming With MEAN stack
I’m thinking about starting to develop a social network similar to Instagram, for learning purposes, using MEAN stack. I thought of my models : User’s: var mongoose = require('mongoose');…
-
1
votes1
answer76
viewsComplex search with Mongodb
I have a structure in mongoDB that has quantities of different items within an array called "items". To do the search, I am using the command below, which first transforms the content into a string,…