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
-
3
votes1
answer649
viewsHow to change a record in Mongo through a function and update Node?
I have a problem. I have a dataset inside Mongo, a json that has been returned from a url request pa/ with app.get('/pa', function (req, res) { paController.list(function(resp) { res.jsonp(resp);…
-
3
votes1
answer576
viewsHow to search for the longest date in Mongodb along with other parameters?
I have a schema date, status and code: var entregaSchema = mongoose.Schema({ codEntrega: String, placaPipa: String, codRota: String, codMA: String, dataMA: Date, localMA: String, codPA: String,…
-
3
votes1
answer428
viewsPHP - Real Time Application
A doubt I need to make an application that from time to time validates whether a session is valid through a bank query. This query must be done automatically, without the need for a user action,…
-
3
votes1
answer70
viewsHow to protect myself against "Mongoinjection"
Use Mongodb in a front-end application that runs on Node.JS through the Express framework. I would like to know how to create protections against Mongodb "Injection" (similar to sql Injection).…
-
3
votes1
answer89
viewsHow to delete all Mongodb Collections in Laravel
A good practice in TDD is to keep the database clean between tests. For this, Laravel uses the Trait RefreshDatabase. However, this still doesn’t work for the Mongodb database. My idea is to delete…
-
3
votes1
answer565
viewsInjection of dependency Generics<T>
Good morning friends. I hit a rough patch and I’m not getting past it. I have 2 projects, a webapi and a standard class, both in dot net core. In my standard design, I am working with Repository to…
mongodb generic dependency-injection .net-core asp.net-coreasked 7 years, 1 month ago Guilherme Dietrich 31 -
3
votes2
answers51
viewsAre Mongodb’s "id" unique among collections?
It is possible that the same ObjectId is generated for a document in two different collections in the same database?
-
3
votes1
answer155
viewsSearch dates among other dates in Python
Good morning, I have a database on Mongo DB like this: { "_id" : ObjectId("5addb57d0043582d48ba898a"), "base" : "EUR", "date" : "2018-04-23", "rates" : { "BRL" : 4.175076 } { "_id" :…
-
3
votes1
answer703
viewsNodejs - Problem sending a POST with object array
I’m using Nodejs + Mongodb, and I’m trying to send an array of Book, via method POST, but somehow it’s giving problem, because when using Postman and clicking Send, it just returns me: { "_id":…
-
3
votes1
answer197
viewsHow to select 2 objects from an array
How can I select only 2 items from a array from inside my Center? example: { "name": "xpto", "age": 11, "lista": [{"s": 1}, {"s": 2}, {"s": 3}] } I need to get the items you own s with 2 and 3 where…
-
3
votes2
answers389
viewsHow to return the number of elements of a document property in a collection in Mongodb
Hello, I have a collection that has the documents with the format below: { "_id" : ObjectId("..."), "checked": true, "styles": ["foo", "bar", "bin"] } I need to add the array size styles for all…
mongodbasked 5 years, 1 month ago LeandroLuk 4,989 -
3
votes3
answers1466
viewsTypeerror: Cannot read Property 'filename' of Undefined
I intend to store the file in the folder uploads and secure in the bank the name of the file. The console.log() show me this: {theBook: undefined, cover: undefined} Stores the image in the folder…
-
3
votes1
answer66
viewsInsert an information into two Collections in Mongodb with Node.js
I have two degrees: courses and participants. an attendee when enrolling in a course, when I give a GET in any course, needs to return the enrolled attendees(participants) and when giving a GET to…
-
3
votes2
answers928
viewsHow to hide Axios request data in Javascript (JS Node)
Hello, I’m developing an application and setting up a user registration screen, but I’m wondering if it’s possible to hide the data that Axios is requesting for the API. My Javascript code, which I…
-
3
votes2
answers450
viewsWhat is Aggregate in Mongodb?
I know this kind of doubt I find "easily" in the documentation itself and on the internet, however even in the official documentation became very confused and very technical with several unknown…
-
2
votes2
answers348
viewsIs there any way to search (FULLTEXT) in a specific field in Mongodb?
I have a full-text index in Mongodb and I need to search only on top of one field instead of all. Does anyone know if this is possible?
-
2
votes2
answers186
viewsDB Dinamico Mongodb
I’m starting a web project and I’m thinking about using java with mongoDB and Spring data. In this web project, each user would have their own database. That is, when the user logs in (this yes…
-
2
votes1
answer125
viewsInstall Mongodb on another drive on Windows
I’m trying to install Mongodb in a unit other than "C". However when trying to use the "Mongo" command in the terminal the following error is returned: Failed to connect to localhost:27017 The…
mongodbasked 10 years, 1 month ago Filipe Moraes 8,737 -
2
votes1
answer474
viewsMongodb - Large Collections of Documents
I’m developing a website where users can vote for or against places they know about. To do this I could create a collection called "votes" relating the site to the user and whether it was for or…
mongodbasked 9 years, 10 months ago Fábio Lemos Elizandro 834 -
2
votes1
answer119
viewsError writing to Mongodb using C#Parallelism
I have a collection on Mongo that has subdocuments, so I read xml files and write them to Mongodb. Each xml file is a document in Mongo. My classes public class Cabecalho { public Cabecalho() {…
-
2
votes1
answer134
viewsConfigure Relational and Non-relational Databases in the same project with Spring-Data + Hibernate
I am trying to create a Java application where I need to configure two databases: Mongodb and Mysql. My idea is to use Spring-Data with Hibernate for both banks, but I found only tutorials for…
-
2
votes0
answers37
viewsHow to disable numberLong in Mongo 3?
How to disable numberLong in Mongo 3? I’ve tried to mongo.native_long=0 and did not resolve. I’m using perl with mongoexport I’m using perl with mongoexport…
-
2
votes0
answers164
viewsMongodb + Intel XDK
I need to use Mongodb inside the Intel XDK, to log in, register, save coordinates, then display on a map, etc... Anyone have any tool suggestions? Thanks in advance!
-
2
votes1
answer1704
viewsEdit an element within an object, within an array, with Mongoose
I could use a hand! I am new to Node.JS and decided to "create a system" to put into practice what I already know and create challenges to encourage my learning! I did a beginner workshop (with Jean…
-
2
votes2
answers1366
viewsimage upload with media content
How do I upload an image to meteor? I followed this tutorial here but it didn’t work very well. The image is apparently saved, because I checked on Collection and there is a record there, but I…
-
2
votes0
answers121
viewsWeb2py - Auth - Mongodb Authentication
I’m trying to use Mongodb with Web2py, and for that I started with authentication, but there are some errors that I don’t understand. In a relational database, Web2py creates the authentication…
-
2
votes1
answer329
viewsFind in Bank Mongoose by Nodejs
I’m trying to access the Mongoose bank, doing a find on the nodejs. In Mongoose, I have the following data: Client:{ name: {type: String, trim: true, required: false, default: ""}, address:{…
-
2
votes1
answer763
viewsWhat is the correct way to structure addresses in Mongodb?
When I learned SQL, the way address was structured was to create a series of tables (neighborhoods, cities, states, countries). So I listed the tables. Then just add only the neighborhood id to the…
-
2
votes2
answers1431
viewsRemove duplicate Mongodb records
I have a collection with the field called "contact_id". In my collection I have duplicate records with this key. How can I remove duplicates resulting in just one record? I’ve tried to: db.Person…
-
2
votes1
answer225
viewsReference or embed documents in mongodb and couchdb
I’m thinking of creating referenced documents instead of embedded because I have a database where a plane has flights and flights have airports. Someone experienced enough to tell me the best…
-
2
votes1
answer312
viewsLock on the mongoDB
Good guys, I am using mongodb to develop projects in college, I would like to know (documentation is weak on the site of Mongo https://docs.mongodb.org/manual/faq/concurrency/ ) how the lock works…
mongodbasked 8 years, 8 months ago Lucas Fantacucci 435 -
2
votes2
answers515
viewsHow to get duplicated records with mongoDB and Morphia?
How do I get mongoDB to return me a list of un-duplicated documents. In my case mongoDB returns a list of ingredients from all registered recipes, but I want these records without duplication…
-
2
votes2
answers494
viewsHow to make a daemon for the "mongod" command
What is the procedure for letting Mongo run on the server without having to use the command mongod? Is there a specific command of Mongo for this?
mongodbasked 8 years, 4 months ago David Coelho 621 -
2
votes1
answer501
viewsError installing Mongo-hack on Ubuntu 14.04
When installing Mongo-hack on Ubuntu the following error is being generated: npm install -g Mongo-hacker | [email protected] install /usr/lib/node_modules/Mongo-hacker make install cat config.js…
-
2
votes1
answer464
viewsSearching for documents with mongoDB
I am using mongoDB 3.2 with Java. You can save a mongoDB query to a list of objects in a class of mine? I want to save the query directly on a list of people. class Pessoa{ String nome; Date…
-
2
votes1
answer645
viewsInserting documents from Mongodb
I have the following document(Schema): var CandidatoSchema = new Schema ({ id_login: Schema.Types.ObjectId, nome: String, cpf: String, dataNascimento: Date, sexo: String, estadoCivil: String,…
-
2
votes1
answer1163
viewsMongoose - Single object in an array
I’m new to Mongodb and Mongoose, I’d like to ask a question. I would like to store multiple objects in an array, the object being ONLY unique in that array, based on a string. See in the example…
-
2
votes1
answer74
viewsMongodb stops inserting documents
I am entering some records, but after a while, it does not let insert more. It follows the console error: java.lang.IllegalStateException: Failed to execute CommandLineRunner at…
-
2
votes0
answers44
viewsMongo(3 shards) C++ Driver: Syncclusterconnection error
I’m having trouble running the upsert on Mongo when I connect to 3 shards on cpp. Now when I connect in just one of the shards I can do the operation. Does anyone have any alternative or knows the…
-
2
votes1
answer219
viewsModel of the Mongodb
Hello! I’m starting to use Mongodb with Mongoose on Nodejs and I’m finding a strange behavior when creating Models mesus on Mongodb. Example: mongoose.connect('mongodb://localhost/db_teste'); const…
-
2
votes1
answer42
viewsI’m not able to load just one element of an array at a lower level on mongodb
Person I’m trying to pull just one helper, I’m doing the following, db.colecao.find( { functio.nome : joão }, { 'functionary.helper. $' 1 } ); but always comes everyone, I’ve tried several ways, Bs…
mongodbasked 7 years, 3 months ago wedson santos 81 -
2
votes1
answer307
viewsHeroku - Connect with mongoDB addon mLab
I need to connect to the Mongo database using the mLab addon. But I can’t enter or list when I run in local mode it’s working. I have the variable set: Any idea what it might be? My app.js var…
-
2
votes0
answers177
viewsHow to popular a sub list of a document with Mongoose?
Is it possible to popular a list that references another list in the same document? Example in the image below, I want to popular/return in a search always the access link referring to another list…
-
2
votes2
answers1240
viewsIs there a way to auto-increment the id in Mongo?
You can do this, every time I create a new user for example it auto increments _id. Starting from 1 and going up to the number of users
-
2
votes0
answers98
viewsCosmos DB Error: Request rate is large
I’m making a filter to get the last record sent to a collection by a device and the query is very simple: db.getCollection('Device').find({'ID':'1234'}).sort({DateTime: -1}).limit(1) however, if I…
-
2
votes0
answers437
viewsHow to handle errors in Mongoose optimally
I am starting to work with Mongodb + Mongoose and I am having problems dealing with the mistakes that Mongoose generates. One of the same is when there is a duplicate key for a parameter that should…
-
2
votes1
answer440
viewsRelationship between Mongodb collections
I wonder if it is good practice to create a relationship between two collections (Collections) in Mongodb. Suppose I have a collection for users, with a scheme like this: { "_id": ObjectId(...),…
-
2
votes1
answer113
viewsSearch and replace mongodb database
I have several collections in mongodb and would like to do a "search/replace" for all collections and for each field that is the string "http:" replace with "https:" Example: var object = { "_id" :…
-
2
votes1
answer121
viewsAlways start Mongodb
Whenever I will use Mongodb in a local development environment, I have to open the terminal and type: mongod So you can use Mongodb’s services. Since my operating system is Windows10 (64 bit), how…
-
2
votes2
answers189
viewsmongodb getNextSequence error is not defined
Good morning, I am unable to create and execute this function in mondodb 3.4 I’m following this tutorial: Create an Auto-Incrementing Sequence Field Error Error: Referenceerror: getNextSequence is…