Questions tagged as 'mongodb'

1
answer

How to get the latest registration | mongoDB | Nodejs

I am developing a small project and I have a very simple question, if I have in DB a few records, for example these: { { 'name':'nombre1', 'edad':'22' }, { 'name':'nombre2', 'edad':'23' }, { 'name':'nombre3', 'edad':'24' }, }...
asked by 14.03.2018 / 02:15
2
answers

How to clean the mongodb data base in debian

For some reason my mongodb data base is corrupt (it does not behave as it should "Dup key: {: null}" mongodb error, and I would like to clean it, delete all its data completely. I'm in Debian and I do not know which is the easiest way to do it...
asked by 09.06.2017 / 22:05
2
answers

Difference in Java and JS when creating a class and instantiating it?

I am using JS to perform an API and as much as I try I can not understand why, when making a POST request to create a user, it tells me that User is not a constructor. I am "new" in JS and I have in mind the creation of classes / constructors...
asked by 18.03.2017 / 13:24
1
answer

Save and Actulize document arrays created dynamically

Good morning, I am working with mongodb and mongoose, and I have the following problem. I have a collection that is made up of a field, which must be an array ( yearsData that will be seen below) that will keep a record of other years, so...
asked by 16.11.2016 / 15:07
2
answers

Because my database file is so big in mongoDB

I have a query with the size of the database in mongoDB. I copied a Postgres table from 3 million records to mongoDB. The table in Postgres weighs 400Mb. The collection in mongoDB weighs 1.6Gb Is there something I'm doing wrong or just in...
asked by 19.08.2016 / 20:49
1
answer

How to wait for the answer of a query in MongoDB with NodeJS?

I have a MySQL database in which I keep address information that a device goes through. In this table I have the fields "latitude", "longitude" and "direction". And the main idea is to pass those records from MySQL to Mongo, but I want to avoid...
asked by 24.08.2018 / 19:33
1
answer

How not to duplicate data in MongoDB (with NodeJS), migrating from MySQL

I am evaluating the possibility to start working with MongoDB using NodeJS, however, I am formatted to think in SQL and not in noSQL, I find myself with the following dilemma which takes a day chewing and all post / tutorials They seem to ignore...
asked by 30.09.2018 / 17:33
1
answer

Search by date in MongoDB

I have a collection called users and within this I have an arrangement of objects called news and I need to make queries by date and you _id:1 nombre: "Jorge Hernandez" nuck: "ADES" twitter:"[email protected]" descripcion:"nice" nivel: 57 ciuda...
asked by 18.08.2018 / 01:43
1
answer

I need help with a Query on a Backend- RestAPI of mongoDB using mongoose

This is the model of the object to which I ask the question const mongoose = require('mongoose'); const userSchema = mongoose.Schema({ _id: mongoose.Schema.Types.ObjectId, email: { type: String, required: true}, nombre: { type: String, requi...
asked by 24.06.2018 / 02:00
1
answer

Does the order of the fields matter when a document is created in MongoDB?

I am learning to use MongoDB and NodeJS. While working, I was wondering if it matters the order of the fields when creating / inserting a new document within a collection. I leave an image to see what I mean, in it you can see how to creat...
asked by 27.07.2017 / 23:02