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
answer3114
viewsRelationship in Mongodb
Folks good afternoon, I’m in need of some help from someone who has experience with Mongodb to clear me a doubt. I’m studying about Mongodb and I came across the following problem: I have 2…
-
1
votes0
answers354
viewsNodejs for real-time applications
Recently, with the arrival of Angular2 beta, I have been looking for more information about real-time applications. Currently I work with AngularJs (1.x) in the front-end with apache server in MySql…
-
1
votes2
answers351
viewsDoubt with mongodb test
I am a beginner in Mongo I have a question with select/query. I need to make a query that searches at the base Yoda and in the collection configuracoes return all documents that hold the key…
-
1
votes1
answer83
viewsHow to ensure security of api’s Rest
I’m creating a system using MEAN Stack and I came up with a question .. My angular client application requests the ex api: POST http://127.0.0.1/api/product If some malicious user found the url of…
-
1
votes0
answers192
viewsHow to model a system of friends with Mongodb?
I’m creating a small social network and I need to create the friendships part. I have two ideas: A Collection Friendships containing the fields sender, destnatary and answer and make a populate with…
-
1
votes0
answers19
viewsMongodb: Find every x days
[Mongodb] Guys, I’m in the following situation: I have several documents saved with the following structure: { ..., repetir : "semanal", a_cada: 2 } In short, I have a cron running daily and I need…
-
1
votes1
answer91
viewsSplit Mongo data into more than one folder. Possible?
I have mongodb running on a 500GB primary drive. As the base started to grow a lot, I put a 1TB slave disk and changed to it the folder date. I know that in time, this 1TB record will also be…
mongodbasked 8 years, 10 months ago Paulo Luvisoto 907 -
1
votes1
answer196
viewsOGM + Mongodb Hibernate module error inside Wildfly 10
I am in need of a help to set up Wildfly 10 with Hibernate OGM and Mongodb... I have the following error: 11:13:17,164 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed…
-
1
votes1
answer71
viewsReturn mongodb Collections in json_encode PHP
I am assembling a REST API in PHP and I am not able to display all the returned Collections of the Mongo search, returns only one. Follow the code for those who can make a contribution I will be…
-
1
votes1
answer118
viewsInitialize server.js IONIC 1 to run in "production"
THE SERVER.JS SHOULD BE STARTED AS SOON AS I RUN IT ON MY MOBILE ? How could I set you up to work that way? This is because I have a service in Mongo, and it needs to be run the connection to Mongo…
-
1
votes1
answer87
viewsSearch mongodb in PHP
I am having trouble returning records through a date filter. I have the following JSON document: { "_id": "111090485635468_1098582396886267", "1098582396886267_1098592810218559": { "fb_id":…
-
1
votes1
answer143
viewsExecute mongoimport command via c#
I need to execute mongoimport command from mongoDB via code but not for sure: `pro.FileName = "cmd.exe"; //pro.UseShellExecute = false; pro.Arguments = @"/k cd C:\Program…
-
1
votes1
answer193
viewsShow username responsible for such ID in html
I am making a very basic forum and I have a very easy question, but I am beginner at the angle and it is killing me. When creating a new topic, this topic creates an ID ie each topic has its own. In…
-
1
votes1
answer516
viewsReuse of connections in Nodejs + Mongoose
I’m starting now with Node and used Mongoose to make my connections to the database in Mongodb. I put 1 log in my application, for every time I open the connection it print in this log. What happens…
-
1
votes1
answer308
viewsUpdate array in Mongodb subdocument
I’m trying to do an update here on mongoshell and I’m having a hard time. I have the following json: { "_id" : ObjectId("56cc03c16f4e85f538ef79ae"), "contact_id" : NumberLong(1000295524418),…
-
1
votes0
answers26
viewsReturn registration only of bets more recent than the current time
wanted to return this record only if all the apostas.horario is greater than the present time, how can I do it in mongodb?…
mongodbasked 7 years, 10 months ago wedson santos 81 -
1
votes1
answer385
viewsNode.js Passport.authenticate is not a Function, how do I fix this?
As requested, I reduced the codes a little and kept only the essentials that I believe are involved with the problem. Reformulating my question: I have a simple registration in a modal (only name,…
-
1
votes1
answer524
viewsBackup and Restor Mongodb - ways
I’m starting in mongodb, linux platform. would like to know what the best backup strategy since: Data import and Export - are used for cvs or json outputs Mongodump and Mongorestore - are used for…
-
1
votes1
answer43
viewsRegister unique embedded documents
I want to add a built-in document, I’m using the $push update, in schema I put the attribute as index: { unique : true }, but not respecting the rule this registering item as the same name Can…
mongodbasked 7 years, 8 months ago wedson santos 81 -
1
votes2
answers482
viewsAuth rules with Nodejs + Passport + Mongodb
Let’s doubt it. I’m using a blog as an example. I have the Administrator. He does a complete CRUD within the system. Besides it I have the Editor and Reviewer. The Editor creates blog posts but does…
-
1
votes1
answer51
viewsExport a mongodb collection that also brings the document size
I have the export of a Collection that owns some documents, I need to export one of these documents and its size. I tried something of that nature: mongoexport -d test -c records -q '{ a: { $gte: 3…
mongodbasked 7 years, 7 months ago Carlos André 145 -
1
votes1
answer191
viewsHow to get DB value for a variable?
I have the following question: I have a database in mongoDB, I search the data by Nodejs it returns everything right, but I would like to play this value of the search for a variable, to make a…
-
1
votes1
answer1254
viewsReturn the maximum sum of Collection with Mongodb
I have a collection in the MongoDB and it has several records and I need to sum up a column by UF and then return the highest value of that sum. For example UF: 'SP', Valor: 10 ---- UF: 'SP', Valor:…
-
1
votes1
answer57
viewsRemove all result Aggregate mongodb array
I have the following total array I need to get only those that have date. { "_id" : ObjectId("58862a838f3e2721f8d920cc"), "total" : [ [], [], [ ISODate("2017-09-07T00:00:00.000Z") ], [], [], [], []…
-
1
votes1
answer178
viewsChanging the default mongodb database of a Meteor application
Hello, I’m starting to work with the Meteor and I am having difficulties to define where the database will be located along with the authenticated access user. Looking on the internet, I found some…
-
1
votes1
answer50
viewsSearch for similarity in Mongo
I need to make a find in my Mongo by likeness example [ { "nome" : "Erick", "codigo" : 1, "periodos" : 10 }, { "nome" : "Erica", "codigo" : 1, "periodos" : 10 }, { "nome" : "Arthur", "codigo" : 2,…
mongodbasked 7 years, 5 months ago Erick Zanetti 403 -
1
votes0
answers23
viewsI’m having a problem creating quickstar with mongodb on aws
When I try to create a Quickstart aws with mondodb I’m getting this error The following Resource(s) failed to create: [Vpcstack]. . Rollback requested by user. Embedded stack…
-
1
votes2
answers102
viewsHow to assign the callback variable "cursor.toArray(err, doc)" to an external variable?
var result = []; var user = db.collection('user'); var cursor = user.find(); cursor.toArray(function (err, doc) { result = doc; }); console.log(result); // console ->…
-
1
votes1
answer170
viewsRelating Nodejs modules to Services Angularjs - Electron
Hello, Everybody! I’m starting a study in Electron and in this application I’m using Angularjs, the detail is that I don’t mean much about, and I can’t think of a way to use the Node without the…
-
1
votes1
answer74
viewsHow to group and aggregate child items in Mongodb?
I am developing a Web Services REST application with Spring Boot and need to group the goals by players in order to show the scorers from the following records: [ { "id": 1, "adversario": "Dois…
-
1
votes1
answer145
viewsDoubt about Mongodb’s relational Schema
const SurveySchema = new Schema({ name: String, pages: [ //um survey pode ter várias páginas { type: Schema.Types.ObjectId, ref: 'Page' } ] }); const PageSchema = new Schema({ name: String,…
-
1
votes1
answer97
viewsHelp with Mongodb
I have a problem using the .find() mongoDB with Regexp. I have the following command: db.collection.find({"city": /SAOPAULO/}) When I do: db.collection.find({"city": /SAO/}) it searches on time, but…
-
1
votes1
answer1366
viewsHow to connect to Mongodb Compass Community?
I installed mongodb on my machine and along with it came the Compass Community program. When I ran mongod.exe you can see the name of the host and the port, so I put the name of the host in the…
-
1
votes0
answers98
viewsKeystonejs with remote Mongo
Good night! I’m starting to study Keystonejs versão 0.3.17. Following the "Getting Started" of the official website, in the prerequisites nodejs and the mongodb, but I want to use that cloud service…
-
1
votes0
answers60
viewsOptimization with Mongodb
I’m starting with Mongodb and I have a question about optimization. COLLECTION BOLAO: [ campeonato : 'Brasil - Série A', confrontos : [ { id : 10, casa : "Sport", visitante : "Chapecoense", horario…
mongodbasked 7 years, 9 months ago wedson santos 81 -
1
votes0
answers44
viewsChanges have no effect when I change Schema, using mongodb and nodejs
Every time I make a change in my Schema I have to restart my server. I’m using the nodemon, but it doesn’t always update, someone has been through it? module.exports = function(app){ var Schema =…
-
1
votes1
answer224
viewsHow to adapt a JSON to create a table in pdfMake?
I need to take a JSON that returns from Mongodb and through a foreach generate a table and create a PDF, but I’m not able to adapt the JSON to the pdfMake structure, follows JSON excerpt: { "_id" :…
-
1
votes1
answer67
viewsPython - Mongo Engine Error: Tried to save Duplicate Keys (Duplicate Key Error)
Python I am trying to save more than one user in Json but it does not accept the introduction of more than one, always gives the: Tried to save Duplicate Unique Keys (Duplicate Key Error) here is…
-
1
votes0
answers143
viewsAvoid repeat names in json
I am looking for a form/function/method so that it is not possible to repeat the value saved in Json, for example: I am saving the json below and do not want to save the same name in json. [ [ {…
-
1
votes1
answer102
viewsInsert Command Line in typescript
I have a Mongodb installation and configuration script as required by the Company. Install_mongodb.BAT But I would like to automate this process including in the project in Typescript. I would like…
-
1
votes0
answers55
viewsAggregate in C# returns nothing?
I made a direct query on the console that returned me what I expected, the query in Mongo is like this. db.AtividadeResultMongo.aggregate([{$unwind: "$LsVariaveisProcesso"}, {$match: { IdAtividade :…
-
1
votes2
answers126
viewsTake over positions of an array after comparison with another array?
I have a function (in Javascript) that compares 2 arrays: let diferencas = []; let numD = 0; for (let a = 0; a < dados.length; a++) { if (dados[a].idEmail === results[a].idEmail) {…
-
1
votes0
answers81
viewsEmpty return webapp when searching for ID in the Mongo DB database (spring MVC+Thymeleaf)
Controller class where the ID search method is found: package br.com.apisw.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import…
-
1
votes1
answer606
viewsSearch by id Mongo
Hello guys I’m following the book Getting Mean but I stumbled across a problem I can’t solve. I have a document I show below taking data from Mongo, and in it I have subdocuments in the case Reviews…
-
1
votes0
answers41
viewsHow to create a view whose filter is based on the date/time of the query?
In the Collection documents lightningStrikes there is a property datetime, whose value is of type Isodate. Every minute several new documents enter this Center. My goal is to create a view that…
-
1
votes1
answer624
viewsRelationship between documents - Mongodb
I have the following model: A schema called suspects, which holds information of suspicious persons. And 3 other so-called alerts, criminal actions and risk events. These 3 other schemas, must have…
-
1
votes0
answers85
viewsCamparation of databases
I receive daily an Oracle database with 12 tables containing on average 8 million records each. I need to treat it to get only the updated day records compared to the previous day’s base, but I…
-
1
votes1
answer82
viewsList all states in Node JS and Mongo
I’m trying to set up a function to list all the states and then print inside an object. Sorry to be so Noob, I think it’s a pretty silly problem. States function listarTodasOsEstados(){ var estado =…
-
1
votes1
answer129
viewsList items of an object in Pug JS, with Node and Mongo
I’m setting up a store, using Keystone JS, installed the dependencies Pug JS and Mongodb. I created a model that is pointing to a view, called Tour.JS The problem is that I couldn’t efficiently list…
-
1
votes1
answer393
viewsHow to create composite key in Mongodb
How can I create composite key in Mongodb and use in C#?