Questions tagged as 'mongodb'

2
answers

Get the value of a document in mongoDB

I have a collection where the documents are like this (in MongoDB): { _id: 'ABPS1001', Marca: 'DecNag', serial: '2393-829-109', resumen: [ { estado: '1', nombresAg: 'Gina', apellidosAg: 'Saenz', coordinador_...
asked by 26.10.2016 / 15:44
2
answers

MongoDB: Search by date in PHP

I have a collection in MongoDB of 45 million records (Actually we had a database in SQL Server, but this is already starting to have problems, so we are moving to Mongo and query the information using PHP. The documents is as follows: { "_id"...
asked by 05.10.2016 / 17:38
1
answer

problems when updating from an array in mongo and nodejs using async

Hi, I have a problem I want to update, a database from an array that I have, to cycle the array and every key that exists in the db that I update ... I have written the code, but I only update the last record .. I do not know why. var...
asked by 16.08.2016 / 17:55
2
answers

Problem when inserting into the Mongo database

This is my code, even if I put the double quotes "", I get the error. Code: $ db.contactlist.insert({nombre:'Daniela', correo:'[email protected]', numero:'(506) 6188-4715'}) I get this error:    bash: syntax error near u...
asked by 26.06.2017 / 21:52
1
answer

Pass nodejs variable (Express) to Javascript [closed]

Suppose I have a database in mongodb, in which I can store some information with .save () but now, I want to retrieve that information and pass it to the client, for which I use findOne () to acquire the desired data , that data I want to pass t...
asked by 21.12.2018 / 05:00
1
answer

I can not import model in route typescript

PS: Apart from the info below, here is the source: link The question is, why can not I access "User" which is a model for mongoose from a route? That's how I have the router. As you can see, User gives me an error "Can not fin...
asked by 05.12.2018 / 14:26
1
answer

Mongodb and dates

I have a problem, when I save a date, it is saved like this: 2018-12-04T00: 00: 00.000Z and I would like the time to be 23:00 not 00:00 2018-12-04T23: 00: 00.000Z It's an api, with express and node function SaveOfferDay(req, r...
asked by 04.12.2018 / 10:21
1
answer

Migrate an .sql file to MongoDB?

I want to import a database from a file .sql to MongoDB, the problem is that it weighs 1.7GB. I was researching and found that I can import a database to mongodb as file .json , but the pages to convert to .json do not suppor...
asked by 24.05.2018 / 23:58
1
answer

Insert a sub-document into a Mongoose sub-document

I currently have an object like this: { _id: 5ab5051ec97a4202984f2973, student_code: "1234567890", name: "myname", lastname: "mylastname", areas: [] } With mongoose I can insert a sub-document in areas like this: .post(fu...
asked by 23.03.2018 / 15:23
3
answers

MongoDB. Is there a way to relate collections?

I am working with a CRUD app with the MEAN stack to keep track of patients, I have a requirement to add a medical history to the patient with the particularity that when you delete a patient, only the patient is deleted, and your medical history...
asked by 25.08.2017 / 23:47