Questions tagged as 'mongoose'

0
answers

Mongo access using fetch javascript

Hello, I'm developing a simple system with nodejs and javascript. The system consists of the registration of a driver, a passenger and a race containing a driver and a passenger. I am using mongodb as a database. I have already created the AP...
asked by 12.05.2018 / 17:37
0
answers

Make Schema field unique for a single field

I have a problem that I am breaking the head: I'm developing a REST API that uses MongoDB and I need Mongoose to not allow insertion via POST into the database fields that are not unique when linked to an ID. Example: {'_id': '1234', 'fi...
asked by 12.04.2018 / 21:54
0
answers

Adding elements to a mongodb database

With a problem, I'm trying to insert a new record in my database, where the entry is a {url: "example.com } I'm using the express framework, the mongodb database and the mongoose library (I've been able to do other things, add an id, delete an i...
asked by 15.04.2018 / 05:08
0
answers

Mongoose I can not use attribute ref as parameter in find;

I have the following schemas: const livroSchema = new Schema({ nome: { type: String, required: true }, editora: { type: String, required: true }, autor: [{ type: String }], categoria: [{ type: String }],...
asked by 24.03.2018 / 06:52
1
answer

MongoDB on the air at AWS

I need a help, I did not find anything practical and accurate in google, I have a node backend and using mongoose, and I can run locally quietly, because in CMD I execute the command 'mongod', and my mongo local is in the air, and I connect by c...
asked by 22.03.2018 / 14:50
0
answers

Query with Mongoose

I have the following key: How can I make a query that returns all values (values of the composition key and measureUnityId. Return the name, for example) using NodeJS + Mongoose?     
asked by 21.03.2018 / 16:14
1
answer

Model, Express and Mongoose

I have the following code in express.js const express = require('express'); const load = require('express-load'); module.exports = () => { var app = express(); var bodyParser = require('body-parser'); //variável de ambiente app.set('po...
asked by 13.03.2018 / 21:55
0
answers

Mongoose saving date with previous day

I have a calendar schema that has the date field: const mongoose = require('../config/db'); const AgendaSchema = new mongoose.Schema({ nome: { type: String, require: true }, local: { type: String, require: t...
asked by 01.03.2018 / 15:54
0
answers

UPDATE ON MONGODB USING $ PUSH

The $ push operator in mongoDB accepts only numeric value to change when I try to do sub = 1 , for example, it does not work. In the first example I can update normally (static), in the second not. db.my_collection.updateOne({"_id":3, "p_act"...
asked by 20.02.2018 / 15:09
0
answers

Error MongoDB - geoNear "no geo indices"

To get a MongoDB database I use the following code: router.get('/multibancos', function(req, res, next){ MB.aggregate().near({ near: { type: "Point", coordinates: [parseFloat(req.query.lng) , parseFloat(req.query.lat)] },...
asked by 08.02.2018 / 23:19