Questions tagged as 'mongodb'

1
answer

Problem with a NodeJS and MongoDB connection with Mongoose

I am trying to create a connection between mongodb and nodejs, my code is as follows: const express = require('express'); const bodyParser = require('body-parser'); const pug = require('pug'); var app = express(); var mongoose = require('mongo...
asked by 12.06.2017 / 07:09
1
answer

Hello world with MongoDB!

Objective: make a hello world with MongoDB in Node.js, which consists of saving an email and password in a BD called mi_bd. Problem: I have a form with two input text for the email and user, and when I submit, the browser returns The dat...
asked by 03.02.2017 / 05:13
2
answers

MongoDB query

I am trying to make a query in MongoDB , and it is not clear to me how to do it. Through the following line, I get what is shown: I would like to know if there is any way to obtain only the field in question, ie "qfmSLTmr3tyZwykaA...
asked by 31.01.2017 / 18:52
2
answers

How to get the Id of the last record inserted in MongoDB and C #?

I'm working with MongoDB and c #, this is the way I insert Data. My Class Employees public class Empleados { public string Nombre{ get; set; } public string Direccion { get; set; } } Button Method Empleado...
asked by 13.12.2016 / 22:46
2
answers

error when connecting to mongodb

I have a problem when I want to access the mongo console, I raise the service with brew and when I try to enter the mongo shell I get this error: MongoDB shell version: 3.2.8 connecting to: test 2016-08-17T08:47:10.650-0300 W NETWORK [thread1...
asked by 17.08.2016 / 13:57
0
answers

Insert a laravel Array to MongoDB

I need to know how I can insert an array (that was obtained from a MySQL query) to mongodb (it should be inserted in the same way in mongodb as an array), this is what I have done but it does not keep me as it should be. public function create...
asked by 07.12.2018 / 22:23
1
answer

Is it possible to make the average of all the values of a collection related to ObjectId?

I have these two collections: var wineSchema = new Schema({ name: { type: String }, //nombre del vino code: { type:String}, type: { type: String, enum: ['Tinto','Rosado','Bl...
asked by 17.03.2016 / 18:29
0
answers

I can not apply the intersection operation in mongo from php7

this is my code: <?php try { $manager = new MongoDB\Driver\Manager("mongodb://localhost:27017"); $condition = [ 'unidad'=>['$geoIntersects' => [ '$geometry' => [ 'typ...
asked by 24.10.2018 / 05:22
0
answers

script in bash to store the result of a Mongodb query

I hope that someone can help me. I need to create a bash script that connects to a Mongodb: mongo --host mongodb://IP:PORT,IP:PORT/admin?replicaSet=rs0 -u admin -p passadmin select the db: use Data and launch the query: db.OPERATI...
asked by 11.10.2018 / 14:27
1
answer

How can I do a find to search on an ObjectID in mongoose?

For example I have two models in mongoose: var Persona = { nombre: "Luis", carros:{ type: Schema.ObjectId, ref:'Carro' }, apellidos:"Colx Redex" } var Carro = { modelo:"FX-200", velocidad:"300km/h", marca:"Nissan" }...
asked by 08.09.2018 / 22:15