Questions tagged as 'mongodb'

1
answer

UnhandledPromiseRejectionWarning: I believe it is after searching on mongodb

I believe that this problem is in this part of the code, funny that used a very similar code but does not give the error: UNSOnline.post('/resetpass', (req, res) => { db.collection('alunos').findOne({email: req.body.email}) .then((doc)=>...
asked by 04.06.2017 / 16:36
1
answer

MongoDB for multi user data

I'm developing an application to the best ERP style, but much simpler. It is a MEAN (MongoDB, Express, Angular 2 and NodeJS) program and also has an Android version made with Ionic 2. It is still in development, but is already fully usable. F...
asked by 07.04.2017 / 22:06
1
answer

Delete single quotes, double quotation marks, commas, line breaks, and records with the same value as a field in mongodb

I have a collection in MongoDB of Tweets, these records have a field called text, in this field I need to delete records that have the same value besides removing single, double, commas, and line breaks. For the removal of the data with the dupl...
asked by 10.03.2017 / 16:58
1
answer

Node JS and MongoDB - Return data from a model to a route

I'm new with Node JS + MongoDB and I have a question about two days that I could not figure out how to solve it. My problem is this: I have a route file that makes a call to a model, as in the example below: Route file: 'use strict'...
asked by 03.04.2017 / 14:47
1
answer

Relationship 1: N and N: M MongoDB parse-server

I have two questions on how to model a mongo database Home 1: In 1: N, with mongodb, should I save in the child entity the ID of the parent entity object, or the parent entity save an Array with the child IDs? In the Parse-Server I could not...
asked by 07.05.2017 / 16:20
1
answer

Python - Error in Mongo Engine, Error: Tried to save duplicate unique keys (Duplicate Key Error)

Python is trying to save more than one user in Json but it does not accept the introduction of more than one, it always gives the:    Tried to save duplicate unique keys (Duplicate Key Error) Here is the code: from .model import User, U...
asked by 29.08.2017 / 21:27
1
answer

How to transform the FindIterable of a query in the database (mongoDB) to a list of DTO objects.

   Bank structure: >db.produtos.find().pretty(); { "_id" : ObjectId("58879057e53276e2f7bf43be"), "descricao" : "Bisnaguinha", "preco" : 4.8 } { "_id" : ObjectId("58879067e53276e2f7bf43bf"), "descicao" : "Nutella", "...
asked by 24.01.2017 / 18:57
1
answer

App name error in django

In my views, from django 1.10, I have the code: from django.shortcuts import * from appcrud.forms import * def inicial(request): if request.method == "POST": form = FormCrud(request.POST) if form.is_valid(): form.save() e...
asked by 04.02.2017 / 04:48
1
answer

$ lookup in db.createView ()

I have a database with two collections : companies and people . And I want to create a view named "peopleSectors" from collection people . db.createView ( "peopleSectors", "people", [ { $lookup: { from: "...
asked by 23.12.2016 / 18:59
1
answer

How to delete a specific document from a collection in MongoDB?

The remove () method used in this way: db.collection.remove () removes all documents from a collection, how do I remove a specific document?     
asked by 10.10.2016 / 08:50