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
answer33
viewsMake a query with pymongo filtering by a string ignoring uppercase and minuscule letters
I need to make a query in a database in Mongodb using the pymongo library in python, the query I am making is as follows: dbCliente.find({"nome": "carlos"}) I want to return the client whose name is…
-
0
votes0
answers36
viewsUpdate to all collection records in Mongodb
I have created a new field in my collection, but I would like to include this new field in all my collection records. I tried to use the script that way: db.getCollection('Contratos').update( {},…
mongodbasked 3 years, 8 months ago André Ricardo 29 -
0
votes1
answer58
viewsMongodb query works in shell, and does not work in PHP
I need help with the query in the mongoDB database, in the shell I can perform the search normally, however on the site I get the error 'not authorized for query on'. I use the mLab service for…
-
0
votes1
answer20
viewsError sending mongodb information on Node
Hello guys I’m having the following problem, my Node is accusing error: ReferenceError: Cannot access 'user' before initialization I am working with Schema user record in the case below I show a…
-
0
votes0
answers31
viewsProblems with Mongoosis research
I’m having a problem doing research on moongose, I have a function that does research for all ids which I send when I pass the id amid "5a01e1dbaf371d00152eae89" works very well but if I pass by the…
-
0
votes1
answer245
viewsHow to edit an attribute in the database?
I’m developing one API where I want to edit information of users after the login. I already have catch the user information after logging as you can see in the function: memberinfo…
-
0
votes0
answers83
viewsMongodb error - geoNear "in geo indices"
To get a Mongodb database use the following code: router.get('/multibancos', function(req, res, next){ MB.aggregate().near({ near: { type: "Point", coordinates: [parseFloat(req.query.lng) ,…
-
0
votes1
answer399
viewsUpdate object array in Mongodb with Node?
Good evening, everyone. I’m developing a simple chatbot for testing purposes, but I ran into a problem. I have a user, when starting a conversation, a bot is generated, and this bot has an array of…
-
0
votes0
answers235
viewsC# & Mongodb - How to filter in child document?
I am starting my adventures in Mongodb and I have a problem specifically with the filtering of documents. The model of my application: public class MatrizCurricular { [BsonId] public ObjectId _id {…
-
0
votes0
answers979
viewsProblem while booting mongodb on Windows
The mongodb stopped working on my computer overnight, when I type "mongod" in the cmd appears the following log: 2018-02-14T12:23:31.189-0700 I CONTROL [initandlisten] MongoDB starting : pid=31268…
mongodbasked 6 years, 9 months ago César Felipe 467 -
0
votes1
answer290
viewsError Unsupported projection option: $project "code":2,"Codename":"Badvalue"
I’d like to search where I want only the records where watson is equal to true and node-visited is equal to Bem-vindo I was doing it this way db.getCollection('conversations').find({'watson':true},…
-
0
votes1
answer188
viewsHow to iterate PHP array received as JSON?
I got the following JSON, that I create by the method JSON.stringify(dados), and walkthrough ajax to the php: {"nome":"nome_da_pessoa", "registro":"registro_da_pessoa",…
-
0
votes1
answer60
viewsAccess one module from another
Well, I’m learning how to implement MVC with the Express framework, but I came across the following situation in my app.js file: var express = require('express'); var consign = require('consign');…
-
0
votes0
answers89
viewsreturn object returned from bank to front-end
I don’t understand why you return On the Node.js server: //Insert user router.post('/', async function(request, response) { let object = { name: request.body.userName, password:…
-
0
votes0
answers84
viewsError inserting documents into Mongodb
I made these Inserts by the shell of the Mongo: db.Operators.insert([{ Name:'Paulo de Tarso', Version:1 }, { Name:'José de Arimatéia', Version:1 }, { Name:'Catarina Silva', Version:3 }]) This is my…
-
0
votes2
answers152
viewsNode with mongodb not starting application
I’m trying to raise an application in Node with mongoose, (I am studying, MEAN book code house) and generates me the following error while trying to start the file server.js where I start my…
-
0
votes1
answer881
viewsGet attribute inside an array in Mongodb
Hello, friends. Good evening! I’m having a problem developing an api, I need to query some attributes within an array of a Schema in Mongodb to add them to an email for an order. Could someone help…
-
0
votes1
answer192
viewsGenerate an array from a query in mongoDB (Mongoose)
Good morning! I need the data from a collection of Mongo on the front end. I’m using Mongoose as ODM, and I got a little lost in sending the data to the front end. In the query it returns me the…
-
0
votes1
answer62
viewsConnection screen of adminMongo
I installed the adminMongo. I followed the installation instructions: Navigate to Folder & install adminMongo: git clone https://github.com/mrvautin/adminMongo.git && cd adminMongo…
mongodbasked 6 years, 3 months ago Jose Henrique 337 -
0
votes1
answer123
views -
0
votes1
answer93
viewsFilter issues in lib API QUERY PARAMS
I am using this lib to apply filters api-query-params I need to perform the filter for this entity; 'use strict' const mongoose = require('mongoose'); const Schema = mongoose.Schema; const schema =…
-
0
votes1
answer68
viewsPrint Mongodb BSON with several different structures
I’m making an application using Python (Flask) and Mongodb. In this application the user can mount his page by inserting Images, Text or Youtube link. With the sequence you want. This first part I…
-
0
votes0
answers553
viewsCannot read Property 'Collection' of Undefined
Error: TypeError: Cannot read property 'collection' of undefined at Object.findAll (/Users/filipealves/node/crud/db.js:7:17) at /Users/filipealves/node/crud/routes/index.js:6:13 at Layer.handle [as…
-
0
votes1
answer264
viewsconsider all fields when grouping in mongodb
I have the following array: [ { “user”: “USER1”, “last”: “USER1” }, { “user”: “USER1”, “last”: “USER2” }, { “user”: “USER2”, “last”: “USER1” }, { “user”: “USER2”, “last”: “USER2” }, { “user”:…
mongodbasked 6 years, 2 months ago Vinicius Spinellis 63 -
0
votes1
answer1294
viewsHow to transform the observable of json into datasource for Angular Material 2
It is returning normally from the database, but when it passes to datasource it is empty Component import { Component, OnInit} from '@angular/core'; import { Tcp } from '../tcp'; import { TcpService…
-
0
votes0
answers301
viewsNode and Mongodb connection problems
A few days ago I’m having a problem with a code that I’m having trouble solving. What I’m trying to do at the moment is to register users in mongodb through Node. I am using the view ejs mechanism,…
-
0
votes1
answer390
viewsHow to send html form to route Node?
I have to send the information from an html form via POST to a CRUD (Create, Read, Update and Delete) acronym in Node and mongodb, but I’m not getting it. Code: // configurando setup e chamando…
-
0
votes1
answer42
viewsMongodb - Find sales containing two products
I am a beginner in Mongodb and would like help with the following question. I have a Collection that has the following structure: {[{id_venda:1, id_produto:20}, {id_venda:1, id_produto:3332},…
mongodbasked 6 years ago Thiago Pires 361 -
0
votes1
answer29
viewsMongodb - Use . distinct in 2 properties of a document
I have the following data set in my database: { "_id": 1, "dept": "A", "item": { "format": "circle", "color": "red" }} { "_id": 2, "dept": "A", "item": { "format": "circle", "color": "blue" }} {…
-
0
votes1
answer1437
viewsNODE.JS - Error: Route.get() requires a callback Function but got a [Object Undefined]
In my roters I create: var express = require('express'); var router = express.Router(); var service = require('./../services/users'); router.get('/login', service.login); router.get('/register',…
-
0
votes1
answer94
viewsRegular expression for wildcard word collection
I am stuck in the following situation: I have a dictionary of words in a mongodb bank, where each word is stored in a document, which has other additional information about it. I need a regular…
-
0
votes2
answers395
viewsMongoose findone do not return values
Guys, I’m having a problem here that I don’t know what else to try, I’m using express + Mongoose. My model let mongoose = require('mongoose'); let users = mongoose.Schema({}, {strict: true});…
-
0
votes1
answer320
viewsDoes not run server.js
You’re making this mistake after npm run dev (I’ve installed the Mongo and the npm models you need) npm ERR! Missing script: dev npm ERR! A complete log of this run can be found in: npm ERR! C:…
-
0
votes1
answer43
viewsMongodb return last value using filter and grouping by variable
I have the following event being inserted into my Mongodb base { _id:"5c0539158863a16a282917ad", owner:"clientX", source:"Deposito01", metric:"temperature", datetime:"2018-12-03T12:09:25.000Z",…
-
0
votes1
answer1875
viewsMissingschemaerror: Schema hasn’t been Registered for model "Product"
Well, I’m following a tutorial on Node.js and Mongodb and I’m trying to create a product, so I create a list of attributes that objects will have, until everything ok. Following the video in…
-
0
votes0
answers56
viewsTwo Forms sending data to an API on Node
I am developing an application with Node and Mongoose. My problem is this: In the back end I have the model of an entity called Equipment. Schema has several parameters. I have a form to create an…
-
0
votes2
answers288
viewsGet instance of connection
I would like to get the dbConnection.js file connection, but run the query in another file (DAO). I am taking a Nodejs course and what I have learned is to get this connection and use a 'managed'…
-
0
votes1
answer608
viewsTypeerror: this. _Connection.open is not a Function
I am doing activity to learn about Nodejs and Mongodb, and during the project, I have the error below: TypeError: this._connection.open is not a function As I am still in the learning phase, I could…
-
0
votes2
answers102
viewsHow to manipulate Mongodb out of the configuration file?
I am studying Nodejs and Mongodb, I can even make the connection and some tests in the bank, but I would like to be able to export the connection with the bank to be able to do…
-
0
votes1
answer141
viewsPool and Transactions with Pymongo
I am making use of Mongodb + Pymongo for the first time, I am looking for information on how to work with Connections Pool and Transactions with pymongo. To date with the documentation found the…
-
0
votes1
answer63
viewsMongodb - Error running find geospatial $near
I have a collection with the following documents. { "_id" : ObjectId("5c6bb6b492647b15f80038a1"), "loc" : { "type" : "Point", "coordenadas" : [ -41.104658, -20.963387 ] } } I’m running the find:…
mongodbasked 5 years, 9 months ago Elton Barcelos 1 -
0
votes0
answers77
viewsproblem to update data at angular
the problem is following when I will update the data of a client I have to enter again all the data but the data that is not used will be null I’m using the angular nodejs and mongodb the code is…
-
0
votes1
answer69
viewsSearch between two values
Well I need to do a search on a collection where I have XI, XF, YI e YF I will send for example x:10, y:9 so I need to identify which location items satisfy that location. Given the items saved in…
-
0
votes1
answer2001
viewsXmlhttprequest failing due to No 'Access-Control-Allow-Origin' [React/Mongo/Axios]
I have a backend running on localhost with the following code: server.js: const port = 3003 const bodyParser = require('body-parser') const express = require('express') const server = express()…
-
0
votes0
answers26
viewsPopulating select with data sent from controller and trying to save to BD
I am sending to form an array to popular select so, controller that sends to the view: const novaForm = async ({ Maquina }, req, res) => { const maquina = await Maquina.find({status: 'livre'})…
-
0
votes1
answer109
viewsReplica Mongodb Set Does Not Connect
I’ve climbed a cluster with Docker, and I’m having trouble connecting to the replicaset. The Docker-Compose is on the github and the instructions that surround it in the readme. Remembering that I…
-
0
votes0
answers50
viewsI cannot access the text that is inside an object array in Mongodb after applying foreach
I am unable to access my array of objects that have been configured in my Schema. Schema using foreach. const quizSchema = new mongoose.Schema( { question: String, answers : [ {first: String},…
-
0
votes1
answer1095
viewsNodejs and Mongo DB - Unhandledpromiserejectionwarning: Mongonetworkerror: Connection 4
I have the following connection code with Mongodb, it was working perfect, but now gives an error. const express = require('express'); const mongoose = require('mongoose'); const path =…
-
0
votes1
answer238
viewsSearching and subtracting dates
I am new in the area and would like to put a difficulty that I am having .. In the Mongo database I have an example table (returning this json) { "_id": "5cb7652fc278309ac78dce2b", "status": "Teste…
-
0
votes1
answer254
viewsBlocked cross-origin request when creating a box
Hello I’m starting in React and I came across a problem, I’m trying to make an app similar to Dropbox, on the main screen you create a box and can upload files, but when I click create this message…